This documentation is archived and is not being maintained.

Uri.Authority Property

Gets the Domain Name System (DNS) host name or IP address and the port number for a server.

[Visual Basic]
Public ReadOnly Property Authority As String
public string Authority {get;}
public: __property String* get_Authority();
public function get Authority() : String;

Property Value

A string containing the server DNS host name or IP address and the service port number.


The Authority property returns the fully qualified DNS host name or IP address of the server specified in the URI, along with the port number for nondefault ports.


The following example writes the host name ( and port number (8080) of the server to the console.

[Visual Basic] 
Dim baseUri As New Uri("")
Dim myUri As New Uri(baseUri,"shownew.htm?date=today")

Uri baseUri = new Uri("");
Uri myUri = new Uri(baseUri,"shownew.htm?date=today");


Uri* baseUri = new Uri(S"");
Uri* myUri = new Uri(baseUri,S"shownew.htm?date=today");

var baseUri : Uri = new Uri("");
var myUri : Uri = new Uri(baseUri,"shownew.htm?date=today");


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

Uri Class | Uri Members | System Namespace