GUID Generation

Leave a Comment
The following example will demonstrates , How to generates the GUIDs.

class Program
    {
        static void Main(string[] args)
        {
            try
            {          
                System.IO.StreamWriter file = new System.IO.StreamWriter("C:\\testGuID.txt");
                for (int i = 0; i < 10; i++)
                {
                    Guid guId = new Guid();
                    guId = Guid.NewGuid();
                    file.WriteLine(guId);
                    //Console.WriteLine(guId.ToString());
                }
                file.Close();
                Console.ReadLine();
            }
            catch (Exception ex)
            {
               // exception
            }
        }
    }

Related Post

0 comments:

Post a Comment