The Guid Struct

The Guid struct represents a globally unique identifier: a 16-byte value.

To create a new random Guid, call the static Guid.NewGuid method:


using System;


class Sample
{
    public static void Main()
    {
        Guid g = Guid.NewGuid();
        Console.WriteLine(g.ToString()); 
    }
}

The output:


e242fdf8-d6de-42ed-97e8-76e8c6ae6df8
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.