Uri.AbsoluteUri Property

Gets the absolute URI.

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

'Declaration
Public ReadOnly Property AbsoluteUri As String

Property Value

Type: System.String
A String containing the entire URI.

ExceptionCondition
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)

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Portable Class Library

Supported in: Portable Class Library
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft