C# Uri PathAndQuery
Description
Uri PathAndQuery
gets the AbsolutePath and Query properties
separated by a question mark (?).
Syntax
Uri.PathAndQuery
has the following syntax.
public string PathAndQuery { get; }
Example
The following example writes the URI path (/catalog/shownew.htm) and query (date=today) information to the console.
//from w w w.ja va2s . c om
using System;
public class MainClass{
public static void Main(String[] argv){
Uri baseUri = new Uri("http://www.java2s.com/");
Uri myUri = new Uri(baseUri, "name/shownew.htm?date=today");
Console.WriteLine(myUri.PathAndQuery);
}
}
The code above generates the following result.