NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Process.GetProcesses (String)

Creates a new Process component for each process resource on the specified computer.

[Visual Basic]
Overloads Public Shared Function GetProcesses( _
   ByVal machineName As String _
) As Process ()
[C#]
public static Process[] GetProcesses(
   string machineName
);
[C++]
public: static Process* GetProcesses(
   String* machineName
) [];
[JScript]
public static function GetProcesses(
   machineName : String
) : Process[];

Parameters

machineName
[To be supplied.]

Return Value

An array of type Process that represents all of the process resources running on the computer specified by the machineName parameter.

Remarks

Use this method to create an array of new Process components and associate them with all of the process resources on the specified (usually remote) computer. The process resources must already exist on the computer, because GetProcesses does not create backend resources, but rather associates them with application-generated Process components. Because the operating system itself is running background processes, this array is never empty.

If you don't want to retrieve all processes running on the computer, you can restrict their number by using the GetProcessById or GetProcessesByName methods. GetProcessById creates a Process component that is associated with the specific process identified on the system by the processId value you pass into the method call. GetProcessesByName creates an array of Process components whose associated process resources share the executable file you pass as the processName argument into the method.

Because the GetProcesses method is static (in Visual Basic Shared), you do not need to create an instance of the Process component before you call the method. You can call the method on the Process class itself.

This overload of the GetProcesses method is generally used to retrieve the list of process resources running on a remote computer on the network, but you can specify the local computer as well, by passing in "." or an empty string ("").

See Also

Process Class | Process Members | System.Diagnostics Namespace | Process.GetProcesses Overload List | MachineName | GetProcessById | GetProcessesByName | GetCurrentProcess