【转】C#打开文件夹并定位到指定的文件

C#打开文件夹并定位到指定的文件

 

public void PositionFile(string sFileFullName) 
     { 
         if (!System.IO.File.Exists(sFileFullName)) return; 
 
         System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo("Explorer.exe"); 
         //string file = @"c:/windows/notepad.exe"; 
         psi.Arguments = " /select," + sFileFullName; 
         System.Diagnostics.Process.Start(psi); 
     } 

 打开指定文件:

 Process.Start("Explorer.exe", @"c:/windows/notepad.exe");

 

 

posted @ 2014-03-04 09:51  知不知道  阅读(291)  评论(0编辑  收藏  举报