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






Uri.Query

  
using System; 
using System.Net; 
 
public class UriDemo {  
  public static void Main() { 
 
    Uri sample = new Uri("http://MySite.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 queury: " + sample.PathAndQuery); 
 
  } 
}

   
    
  








Related examples in the same category

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