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.

适用于