Uri.AbsoluteUri Uri.AbsoluteUri Uri.AbsoluteUri Uri.AbsoluteUri Property

定义

获取绝对 URI。Gets the absolute URI.

public:
 property System::String ^ AbsoluteUri { System::String ^ get(); };
public string AbsoluteUri { get; }
member this.AbsoluteUri : string
Public ReadOnly Property AbsoluteUri As String

属性值

包含整个 URI 的 StringA String containing the entire URI.

异常

此实例代表一个相对 URI,而此属性仅对绝对 URI 有效。This instance represents a relative URI, and this property is valid only for absolute URIs.

示例

下面的示例将Uri实例的完整内容写入控制台。The following example writes the complete contents of the Uri instance to the console. 在显示的示例中http://www.contoso.com/catalog/shownew.htm?date=today , 将写入控制台。In the example shown, http://www.contoso.com/catalog/shownew.htm?date=today is written to the console.

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

注解

属性包括存储Uri在实例中的整个 URI, 包括所有片段和查询字符串。 AbsoluteUriThe AbsoluteUri property includes the entire URI stored in the Uri instance, including all fragments and query strings.

适用于