晕到 可以这样吗? IntPtr t = new IntPtr(app.Hwnd);//创建可杀死的进程 System.Diagnostics.Process p; int k = 0; GetWindowThreadProcessId(t, out k); p = System.Diagnostics.Process.GetProcessById(k); p.Kill();//杀死后台进程 没试过 我去试试
不想隐藏 Application.Restart(); string procName = System.Diagnostics.Process.GetCurrentProcess().ProcessName; foreach (Process thisproc in Process.GetProcessesByName(procName)) { if (thisproc.CloseMainWindow()) { thisproc.Kill(); } } 貌似现在没有以前的状况了
System.Diagnostics.Process p;
int k = 0;
GetWindowThreadProcessId(t, out k);
p = System.Diagnostics.Process.GetProcessById(k); p.Kill();//杀死后台进程
没试过 我去试试
string procName = System.Diagnostics.Process.GetCurrentProcess().ProcessName;
foreach (Process thisproc in Process.GetProcessesByName(procName))
{
if (thisproc.CloseMainWindow())
{ thisproc.Kill(); }
}
貌似现在没有以前的状况了