Uri.AbsoluteUri Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the absolute URI.

Namespace:   System
Assembly:  System (in System.dll)

Public ReadOnly Property AbsoluteUri As String

Property Value

Type: System.String

A String containing the entire URI.

Exception Condition
InvalidOperationException

This instance represents a relative URI, and this property is valid only for absolute URIs.

The AbsoluteUri property includes the entire URI stored in the Uri instance, including all fragments and query strings.

The following example writes the complete contents of the Uri instance to the console. In the example shown, http://www.contoso.com/catalog/shownew.htm?date=today is written to the console.

Dim baseUri As New Uri("http://www.contoso.com")
Dim myUri As New Uri(baseUri, "catalog/shownew.htm?date=today")
Console.WriteLine(myUri.AbsoluteUri)

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: