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);
}
}