April 2002
Intermediate to advanced
1024 pages
23h 26m
English
System.Guid is a structure for manipulating GUIDs. A GUID is a 128-bit integer that is used to identify objects. A GUID can be used to uniquely identify an object across machines or networks. This identifier has a low probability of being duplicated. The following sample allocates a GUID and prints it in various formats. It then allocates another GUID and compares it with the first. Listing B.7 shows an example of using this structure to manipulate two GUIDs (guid.cs).
static void Main(string [] args) { Guid guid = Guid.NewGuid(); Console.WriteLine("Guid: {0} ", guid); Console.WriteLine("Guid: {0} ", guid.ToString("N")); Console.WriteLine("Guid: {0} ", guid.ToString("D")); Console.WriteLine("Guid: {0} ", ... |