MachineName Property
Collapse the table of content
Expand the table of content

HttpServerUtility.MachineName Property

Gets the server's computer name.

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

public string MachineName { get; }
/** @property */
public String get_MachineName ()

public function get MachineName () : String

Not applicable.

Property Value

The name of the local computer.

Exception typeCondition

HttpException

The computer name cannot be found.

The following example stores the server's computer name as a string variable.

String ThisMachine;
ThisMachine = Server.MachineName;
   

String thisMachine;
thisMachine = get_Server().get_MachineName();

var thisMachine : String = Server.MachineName
   

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2016 Microsoft