
0
C# Programmation Réseau: Décomposer un objet Uri
using System; public class MainClass{ public static void Main(){ // Create Uri Uri uriAddress = new Uri("http://www.yourDomain.com/index.htm#search"); Console.WriteLine(uriAddress.Fragment); Console.WriteLine("Uri {0} the default port ", uriAddress.IsDefaultPort ? "uses" : "does not use"); Console.WriteLine("The path of this Uri is {0}", uriAddress.GetLeftPart(UriPartial.Path)); Console.WriteLine("Hash code {0}", uriAddress.GetHashCode()); } } |

C# Programmation Réseau: Vérifier si le port d’un URI est pour le schema par défaut
using System; public class MainClass{ public static void Main(){ // Create Uri Uri uriAddress = new Uri("http://www.yourDomain.com/index.htm#search"); Console.WriteLine(uriAddress.Fragment); Console.WriteLine("Uri {0} the default port ", uriAddress.IsDefaultPort ? "uses" : "does not use"); Console.WriteLine("The path of this Uri is {0}", uriAddress.GetLeftPart(UriPartial.Path)); Console.WriteLine("Hash code {0}", uriAddress.GetHashCode()); } } |

C# Programmation Réseau: Afficher le hashCode d’un Uri
using System; public class MainClass{ public static void Main(){ // Create Uri Uri uriAddress = new Uri("http://www.yourDomain.com/index.htm#search"); Console.WriteLine(uriAddress.Fragment); Console.WriteLine("Uri {0} the default port ", uriAddress.IsDefaultPort ? "uses" : "does not use"); Console.WriteLine("The path of this Uri is {0}", uriAddress.GetLeftPart(UriPartial.Path)); Console.WriteLine("Hash code {0}", uriAddress.GetHashCode()); } } |