This documentation is archived and is not being maintained.

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

Property Value

The name of the local computer.

Exception typeCondition

HttpException

The computer name cannot be found.

The following code 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 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0
Show: