SPWebServer.Address Property
Gets the address of the Web server.
Namespace: Microsoft.SharePoint.Administration
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Syntax
'Declaration
Public ReadOnly Property Address As String
Get
'Usage
Dim instance As SPWebServer
Dim value As String
value = instance.Address
public string Address { get; }
Property Value
Type: System.String
A string that contains the address of the Web server.
Examples
The following code example from a Console Application uses the Address property to display the address of each Web server in the SharePoint Foundation deployment.
Dim globalAdmin As New SPGlobalAdmin()
Dim webServers As SPWebServerCollection = globalAdmin.Config.WebServers
Dim webServer As SPWebServer
For Each webServer In webServers
Console.WriteLine(webServer.Address + "\n")
Next webServer
Console.ReadLine()
SPGlobalAdmin globalAdmin = new SPGlobalAdmin();
SPWebServerCollection webServers = globalAdmin.Config.WebServers;
foreach (SPWebServer webServer in webServers)
{
Console.WriteLine(webServer.Address + "\n");
}
Console.ReadLine();