현재 실행 중인 프로세스 목록
-
C# 현재 실행 중인 프로세스 목록닷넷/C# 2017. 9. 8. 10:25
string procName = string.Empty;foreach (System.Diagnostics.Process proc in System.Diagnostics.Process.GetProcesses()){ if (proc.MainWindowHandle != IntPtr.Zero) { if (proc.MainWindowTitle == "") continue; procName = string.Format("{0},{1}", procName, proc.MainModule.FileName); }} 이렇게 하면 프로세스의 파일 경로까지 다 나와서 프로세스 이름만 검출하려고 하는 경우엔문자열을 쪼개는 것이 좋겠다. string procList = string.Empty;string procName = str..