Description





Description

[Note: The UriPartial enumeration defines the values that are passed to the Uri.GetLeftPart method.]

Example
using System;





public class UriPartialSample

{

    public static void Main()

    {

        Uri u = new Uri("http://microsoft.com/page1.aspx#paragraph1");

        ShowLeftParts(u);

        u = new Uri("ftp://microsoft.com/files/myfile.zip");

        ShowLeftParts(u);

        u = new Uri("file://c:\\temp\\myfile.zip");

        ShowLeftParts(u);

        u = new Uri("mailto:[email protected]?subject=test");

        ShowLeftParts(u);

        Console.WriteLine();

        Console.WriteLine();

        Console.WriteLine("Press Enter to continue");

        Console.ReadLine();

    }



    private static void ShowLeftParts(Uri u)

    {

        Console.WriteLine("Uri('{0}').GetLeftPart(UriPartial"

            + ".Scheme) = {1}", u.ToString(),

            u.GetLeftPart(UriPartial.Scheme));

    }





}


The output is

Uri('http://microsoft.com/page1.aspx#paragraph1').GetLeftPart(UriPartial.Scheme)

 = http://

Uri('ftp://microsoft.com/files/myfile.zip').GetLeftPart(UriPartial.Scheme) = ftp

://

Uri('file:///c:/temp/myfile.zip').GetLeftPart(UriPartial.Scheme) = file:///

Uri('mailto:[email protected]?subject=test').GetLeftPart(UriPartial.Scheme) =

mailto:





Press Enter to continue



     Python   SQL   Java   php   Perl 
     game development   web development   internet   *nix   graphics   hardware 
     telecommunications   C++ 
     Flash   Active Directory   Windows