C# winform打开文件夹并选中指定文件

例如:打开“E:\Training”文件夹并选中“20131250.html”文件

System.Diagnostics.Process.Start("Explorer.exe", @"/select,E:\Training\20131250.html");

一句代码搞定!!!

扩展:

1)只打开文件夹:

System.Diagnostics.Process.Start("Explorer.exe", @"E:\Training");

2)打开文件夹并选中文件夹

System.Diagnostics.Process.Start("Explorer.exe", @"/select,E:\Training\js");

 

posted @ 2014-02-27 12:56  yuejin  阅读(5120)  评论(0)    收藏  举报