Gets the Uri.AbsolutePath and Uri.Query components of the URI used to construct the current instance.
A string that contains the values of the Uri.AbsolutePath and Uri.Query properties.
The following example uses the Uri.PathAndQuery property to extract the path and query information from a Uri instance.
C# Example
using System;
public class UriTest {
public static void Main() {
Uri baseUri = new Uri("http://www.contoso.com/");
Uri myUri = new Uri(baseUri, "catalog/shownew.htm?date=today");
Console.WriteLine(myUri.PathAndQuery);
}
}
The output is
/catalog/shownew.htm?date=today