C# 打開文件/跳轉鏈接


mark一下~

打開文件

1.打開文件夾

System.Diagnostics.Process.Start(FolderPath);-- 打開文件夾
System.Diagnostics.Process.Start(FolderPath+"/"+FileName); -- 打開文件夾中某個文件

2.使用資源管理器打開文件:

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

--"Explorer.exe",.exe可以省略

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

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

注:“/select”參數后面有逗號。

跳轉鏈接

  • Process.Start(url); -- 默認瀏覽器
  • Process.Start("iexplore.exe", url);--IE瀏覽器


免責聲明!

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



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