Uri.PathAndQuery Uri.PathAndQuery Uri.PathAndQuery Uri.PathAndQuery Property

定义

获取用问号 (?) 分隔的 AbsolutePathQuery 属性。Gets the AbsolutePath and Query properties separated by a question mark (?).

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

属性值

一个 String,它包含用问号 (?) 分隔的 AbsolutePathQuery 属性。A String that contains the AbsolutePath and Query properties separated by a question mark (?).

异常

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

示例

下面的示例编写的 URI 路径 (/ catalog/shownew.htm) 和查询 (date = today) 到控制台的信息。The following example writes the URI path (/catalog/shownew.htm) and query (date= today) information to the console.

Uri^ baseUri = gcnew Uri( "http://www.contoso.com/" );
Uri^ myUri = gcnew Uri( baseUri, "catalog/shownew.htm?date=today" );

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

注解

PathAndQuery属性包含在服务器和与请求一起发送的查询信息上的绝对路径。The PathAndQuery property contains the absolute path on the server and the query information sent with the request. 它等同于串联AbsolutePathQuery属性。It is identical to concatenating the AbsolutePath and Query properties.

PathAndQuery属性根据 RFC 2396 转义默认情况下。The PathAndQuery property is escaped according to RFC 2396 by default. 如果启用了国际资源标识符 (Iri) 或国际化域名 (IDN) 分析,PathAndQuery根据 RFC 3986 和 RFC 3987 转义属性。If International Resource Identifiers (IRIs) or Internationalized Domain Name (IDN) parsing is enabled, the PathAndQuery property is escaped according to RFC 3986 and RFC 3987.

IRI 支持的详细信息,请参阅备注部分Uri类。For more information on IRI support, see the Remarks section for the Uri class.

适用于