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

IsRemoteMachine() public static method

Gets whether the named machine is remote or local.
public static IsRemoteMachine ( string machineName ) : bool
machineName string The machine name.
return bool
        public static bool IsRemoteMachine(string machineName)
        {
            return 
                machineName != "." && 
                machineName != Interop.Sys.GetHostName();
        }

Usage Example

Example #1
0
        /// <devdoc>
        ///    <para>
        ///       Returns a new <see cref='System.Diagnostics.Process'/> component given a process identifier and
        ///       the name of a computer in the network.
        ///    </para>
        /// </devdoc>
        public static Process GetProcessById(int processId, string machineName)
        {
            if (!ProcessManager.IsProcessRunning(processId, machineName))
            {
                throw new ArgumentException(SR.Format(SR.MissingProccess, processId.ToString(CultureInfo.CurrentCulture)));
            }

            return(new Process(machineName, ProcessManager.IsRemoteMachine(machineName), processId, null));
        }
All Usage Examples Of System.Diagnostics.ProcessManager::IsRemoteMachine