我是 C# 的新手,所以我不确定这是否可行...
我想做的是使用一个应用程序表单通过 Process
启动其他程序,例如记事本,然后在记事本仍在运行时关闭我原来的应用程序。
Process notePad = new Process();
notePad.StartInfo.FileName = "notepad.exe";
notePad.Start();
Application.Exit();
根据我的发现,我必须关闭/终止记事本进程才能关闭正在启动的应用程序。不过,我希望记事本保持打开状态。
有什么办法可以通过 C# 实现吗?
最佳答案
试试这个?
using(Process notePad = Process.Start("notepad.exe","")) { }
Application.Exit();
关于c# - 由于流程,应用程序保持打开状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23708739/