/* The following example demonstrates the method. The output is URI: http://www.contoso.com/index.htmScheme: http://Authority: http://www.contoso.comPath: http://www.contoso.com/index.htmURI: http://www.contoso.com/index.htm#markScheme: http://Authority: http://www.contoso.comPath: http://www.contoso.com/index.htmURI: mailto:address@hidden: mailto:Authority:Path: mailto:address@hidden: nntp://news.contoso.com/address@hidden: nntp://Authority: nntp://news.contoso.comPath: nntp://news.contoso.com/address@hidden/ using System; public class UriTest { public static void Main() { string[] myUri = { "http://www.contoso.com/index.htm", "http:www.contoso.com/index.htm#mark", "mailto:address@hidden", "nntp://news.contoso.com/address@hidden" }; foreach (string s in myUri) { Uri aUri = new Uri(s); Console.WriteLine("URI: {0}", aUri.ToString()); Console.WriteLine("Scheme: {0}",aUri.GetLeftPart(UriPartial.Scheme)); Console.WriteLine("Authority: {0}",aUri.GetLeftPart(UriPartial.Authority)); Console.WriteLine("Path: {0}",aUri.GetLeftPart(UriPartial.Path)); } } }