Gets the name of the computer on which the associated process is running.
[Visual Basic] Public ReadOnly Property MachineName As String [C#] public string MachineName {get;} [C++] public: __property String* get_MachineName(); [JScript] public function get MachineName() : String;
The name of the computer on which the associated process is running.
Exception Type | Condition |
---|---|
SystemException | There is no process associated with this Process object. |
Set MachineName to view the processes running on another computer on the network. For security reasons, you cannot call Start, CloseMainWindow, or Kill on remote computers. You can view statistical data and process information for processes running on remote computers, but you cannot start or stop them. Several Process component members throw exceptions if you attempt to get, set, or implement them on remote computers.
The MachineName can be an empty string (""). Unlike other services like Message Queuing, the local computer (".") is not assumed.
Process Class | Process Members | System.Diagnostics Namespace | GetProcesses | GetProcessById | System.Diagnostics.Process.GetProcessByName