// 目标文件路径
string StartPath = Application.StartupPath + @"\scripts\starthw.bat";
// 选择打开方式文件路径
//记事本
string NotPath = System.Environment.SystemDirectory + "\\notepad.exe";
//sakura
string SakuraPath = @"C:\Program Files (x86)\sakura\sakura.exe";
System.Diagnostics.Process.Start(NotPath, this.StartPath);
System.Diagnostics.Process.Start(SakuraPath, this.StartPath);
本文介绍了一种通过代码启动外部脚本及使用不同编辑器打开文件的方法。具体包括设置目标文件路径、定义编辑器路径,并利用C#的System.Diagnostics.Process.Start方法来启动指定的应用程序。
1634

被折叠的 条评论
为什么被折叠?



