본문 바로가기

Computer Science/Languages

[C#] 프로세스 강제종료 process force kill

728x90
 

 

private static void killps(string processName)

        {

 

            Process[] process = Process.GetProcessesByName(processName);

            Process currentProcess = Process.GetCurrentProcess();

            foreach (Process p in process)

            {

                if (p.Id != currentProcess.Id)

                    p.Kill();

            }

           

        }