June 2002
Intermediate to advanced
816 pages
28h 12m
English
MachineName
stringvar = Server.MachineName
Returns a String containing the name of the server on which the code is executing.
stringvar
A String variable that receives the machine name from the property.
This code example declares a string variable, assigns the MachineName property value to the string variable, and then sets the text property of the Message label to the value of ServerName:
Sub Page_Load( ) Dim ServerName As String ServerName = Server.MachineName Message.Text = "The name of the server is " & ServerName & ".<br/>" End Sub
This property can be useful for code that needs to be easily portable, but needs to access resources that require the server name.
Read now
Unlock full access