System.Diagnostics.ProcessManager.GetProcessInfos C# (CSharp) Method

GetProcessInfos() public static method

Gets process infos for each process on the specified machine.
public static GetProcessInfos ( string machineName ) : System.Diagnostics.ProcessInfo[]
machineName string The target machine.
return System.Diagnostics.ProcessInfo[]
        public static ProcessInfo[] GetProcessInfos(string machineName)
        {
            throw new PlatformNotSupportedException();
        }

Usage Example

 /// <summary>Gets the ProcessInfo for the specified process ID on the specified machine.</summary>
 /// <param name="processId">The process ID.</param>
 /// <param name="machineName">The machine name.</param>
 /// <returns>The ProcessInfo for the process if it could be found; otherwise, null.</returns>
 public static ProcessInfo GetProcessInfo(int processId, string machineName)
 {
     ProcessInfo[] processInfos = ProcessManager.GetProcessInfos(machineName);
     foreach (ProcessInfo processInfo in processInfos)
     {
         if (processInfo.ProcessId == processId)
         {
             return(processInfo);
         }
     }
     return(null);
 }
All Usage Examples Of System.Diagnostics.ProcessManager::GetProcessInfos