This code example demonstrates the Guid.NewGuid() method.
using System; class Sample { public static void Main() { Guid g; // Create and display the value of two GUIDs. g = Guid.NewGuid(); Console.WriteLine(g); Console.WriteLine(Guid.NewGuid()); } }