Process[] pro = Process.GetProcessesByName("aspnet_wp");
if (pro.Length > 0) {
try {
pro[0].Kill();
pro[0].WaitForExit(1000);
pro[0].StartInfo.FileName = "aspnet_wp.exe";
pro[0].Start();
}catch(Exception e){
Console.WriteLine(e);
}
} else {
Process.Start("aspnet_wp.exe");
}[@more@]
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/631872/viewspace-833687/
,如需转载,请注明出处,否则将追究法律责任。