Uri.PathAndQuery : Uri « System.Net « C# / C Sharp by API






Uri.PathAndQuery

  


using System; 
using System.Net; 
 
class MainClass {  
  public static void Main() { 
 
    Uri sample = new Uri("http://www.yoursite.com/somefile.txt?SomeQuery"); 
 
    Console.WriteLine("Host: " + sample.Host); 
    Console.WriteLine("Port: " + sample.Port); 
    Console.WriteLine("Scheme: " + sample.Scheme); 
    Console.WriteLine("Local Path: " + sample.LocalPath); 
    Console.WriteLine("Query: " + sample.Query); 
    Console.WriteLine("Path and query: " + sample.PathAndQuery); 
 
  } 
}

   
    
  








Related examples in the same category

1.new Uri(String uri)
2.Uri.Host
3.Uri.LocalPath
4.Uri.Port
5.Uri.Query
6.Uri.Scheme