打開文件夾:
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爲文件路徑不包含文件名)
擴展提示:可以採用 Application.StartupPath 獲得應用程序所在的目錄。