标签:except start style lin line cep .exe task length
private void Form1_Load(object sender, EventArgs e) { Process[] processes = Process.GetProcesses();//获取所有进程信息 for (int i = 0; i < processes.Length; i++) { if (processes[i].ProcessName.ToLower() == "explorer") { try { processes[i].Kill(); //停止进程 explorer会自动重启 return; } catch (Exception) { Console.WriteLine("进程访问失败!"); } } } } private void button1_Click(object sender, EventArgs e) { System.Diagnostics.Process.Start("taskkill.exe", " /f /im explorer.exe"); //控制台执行结束进程 }
标签:except start style lin line cep .exe task length
原文地址:https://www.cnblogs.com/enych/p/8979038.html