C# Programmation Réseau: Exemple d’utilisationde la classe Uri

Author:
  
/*
C#: The Complete Reference 
by Herbert Schildt 

Publisher: Osborne/McGraw-Hill (March 8, 2002)
ISBN: 0072134852
*/


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


           
         
    
  

Leave a Reply

Your email address will not be published. Required fields are marked *