Uri.AbsolutePath Uri.AbsolutePath Uri.AbsolutePath Uri.AbsolutePath Property

定义

获取 URI 的绝对路径。Gets the absolute path of the URI.

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

属性值

包含资源的绝对路径的 StringA String containing the absolute path to the resource.

异常

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

示例

下面的示例将路径/catalog/shownew.htm 写入控制台。The following example writes the path /catalog/shownew.htm to the console.

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

注解

AbsolutePath属性包含服务器用于解析信息请求的路径信息。The AbsolutePath property contains the path information that the server uses to resolve requests for information. 通常,这是服务器文件系统上所需信息的路径,但它还可以指示服务器必须运行的应用程序或脚本以提供信息。Typically this is the path to the desired information on the server's file system, although it also can indicate the application or script the server must run to provide the information.

路径信息不包括方案、主机名或 URI 的查询部分。The path information does not include the scheme, host name, or query portion of the URI.

适用于