Programaticaly opening folder
A method to programaticaly opening folder with explorer:
string folderToOpen = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"\archive";
string windir = Environment.GetEnvironmentVariable("SystemRoot");
System.Diagnostics.Process proccess = new System.Diagnostics.Process();
proccess.StartInfo.FileName = windir + @"\explorer.exe";
proccess.StartInfo.Arguments = folderToOpen;
proccess.Start();
[/c-sharp]
String variable folderToOpen contains path to “archive” folder under this folder in which the program works.
proccess.StartInfo.FileName contains path to “windows explorep”.
Unique visitors to post: 0