C#关闭调出代码
C#关闭调出代码#region 关闭exe或bat文件,FileName是进程名称 /// /// 关闭exe或bat文件,FileName是进程名称 /// /// 进程名称:FileName="notepad" private void ShutExeBat(string FileName) { System.Diagnostics.Process[] myProcesses = System.Diagnostics.Process.GetProcesses(); foreach (System.Diagnostics.Process myProcess in myProcesses) { if (FileName.ToLower() == myProcess.ProcessName.ToLower()) myProcess.Kill(); } } #endregion Millet 10:41:19 if (Meeting1) { ShutExeBat("rtwdf32"); System.Threading.Thread.Sleep(1000); ExecuteExeBat(@"301.wdf", ""); Meeting1 = false; } else { Meeting1 = true; }
暂无评论