private void StartProcess(string fileName)
{
using (Process pro = new Process())
{
FileInfo file = new FileInfo(fileName);
//在windows服务里面启动其它程序,必须指定WorkingDirectory,其它情况可以不用指定。
pro.StartInfo.WorkingDirectory = file.Directory.FullName;
pro.StartInfo.FileName = fileName;
pro.StartInfo.CreateNoWindow = true;
pro.StartInfo.UseShellExecute = false;
pro.StartInfo.CreateNoWindow = true;
pro.Start();
}
}
C#启动其它程序
最新推荐文章于 2024-04-05 11:29:05 发布