110,536
社区成员
发帖
与我相关
我的任务
分享
private void KillProcess(string processName)
{
System.Diagnostics.Process myproc = new System.Diagnostics.Process();
//得到所有打开的进程
try
{
foreach (Process thisproc in Process.GetProcessesByName("WINPROJ"))
{
if (!thisproc.CloseMainWindow())
{
thisproc.Kill();
}
}
}
catch (System.Exception ex )
{
ScriptManager.RegisterStartupScript(this.btnUpload, GetType(), "dis", "alert('进程杀死失败');", true);
}
}