Skip to Content
.NET Common Language Runtime Unleashed
book

.NET Common Language Runtime Unleashed

by Kevin Burton
April 2002
Intermediate to advanced content levelIntermediate to advanced
1024 pages
23h 26m
English
Sams
Content preview from .NET Common Language Runtime Unleashed

System.Guid

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).

Listing B.7. GUID Example
 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} ", ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Customizing the Microsoft® .NET Framework Common Language Runtime

Customizing the Microsoft® .NET Framework Common Language Runtime

Steven Pratschner

Publisher Resources

ISBN: 0672321246Purchase book