Export (0) Print
Expand All

Uri.PathAndQuery Property

Gets the AbsolutePath and Query properties separated by a question mark (?).

[Visual Basic]
Public ReadOnly Property PathAndQuery As String
[C#]
public string PathAndQuery {get;}
[C++]
public: __property String* get_PathAndQuery();
[JScript]
public function get PathAndQuery() : String;

Property Value

A string that contains the AbsolutePath and Query properties separated by a question mark (?).

Remarks

The PathAndQuery property contains the absolute path on the server and the query information sent with the request. It is identical to concatenating the AbsolutePath and Query properties.

The PathAndQuery property is escaped according to RFC 2396.

Example

The following example writes the URI's path (/catalog/shownew.htm) and query (date= today) information to the console.

[Visual Basic] 
Dim baseUri As New Uri("http://www.contoso.com/")
Dim myUri As New Uri(baseUri, "catalog/shownew.htm?date=today")
       
Console.WriteLine(myUri.PathAndQuery)


[C#] 
Uri baseUri = new Uri("http://www.contoso.com/");
 Uri myUri = new Uri(baseUri, "catalog/shownew.htm?date=today");
 
 Console.WriteLine(myUri.PathAndQuery);
   

[C++] 
Uri* baseUri = new Uri(S"http://www.contoso.com/");
Uri* myUri = new Uri(baseUri,S"catalog/shownew.htm?date=today");
 
Console::WriteLine(myUri->PathAndQuery);

[JScript] 
var baseUri : Uri = new Uri("http://www.contoso.com/");
var myUri : Uri = new Uri(baseUri, "catalog/shownew.htm?date=today");
Console.WriteLine(myUri.PathAndQuery);

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

Uri Class | Uri Members | System Namespace

Show:
© 2014 Microsoft