This documentation is archived and is not being maintained.

HttpServerUtility.MachineName Property

Gets the server's computer name.

[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;

Property Value

The name of the local computer.

Exceptions

Exception Type Condition
HttpException The computer name cannot be found.

Example

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

[Visual Basic] 
Dim ThisMachine As String
ThisMachine = Server.MachineName
   

[C#] 
String ThisMachine;
ThisMachine = Server.MachineName;
   

[C++] 
String* ThisMachine;
ThisMachine = Server->MachineName;
   

[JScript] 
var thisMachine : String = Server.MachineName
   

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

HttpServerUtility Class | HttpServerUtility Members | System.Web Namespace

Show: