使用c#打開文件夾及選中文件


引用:using System.Diagnostics;

打開文件夾:

System.Diagnostics.Process.Start(FilePath);

打開文件夾中某個文件:

System.Diagnostics.Process.Start(FilePath+"/"+FileName);

打開文件夾並選中單個文件:

System.Diagnostics.Process.Start("Explorer", "/select,"+ FilePath+"\"+FileName);

System.Diagnostics.Process.Start("Explorer.exe", "/select,"+ FilePath+"\"+FileName);

用IE打開文件:

System.Diagnostics.Process.Start("Explorer",FilePath+"\"+FileName);

System.Diagnostics.Process.Start("Explorer.exe",FilePath+"\"+FileName);

注:(explorer,explorer.exe,select,不區分大小寫,"/selecet,"其中"/,"都不能少,FilePath為文件路徑不包含文件名)

 打開文件夾並選中網頁

System.Diagnostics.Process.Start("Explorer.exe", ”http://www.sunwale.com/“);

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM