Home     ProductivityTools     Articles     Fun fatcs     How To     C Sharp     Science News     Contact Us     Submit your website     General Blog     Jobs      
c# Keywords
ASP .NET
C# Utopia
How do I add text items t
How to download a file fr
How to print all values i
How to copy text to buffe
How to bind dataset to da
How to parse xml using li
How to launch Bat file
How to launch message box
How to read text file
How to append to text fil
How to set focus on a con
How to generate new GUID
How to generate new GUID 
GUID is globally unique identifier. Guid class in .net contains a static method NewGuid. Use it. Formats are given bleow.
 
 System.GUID.NewGuid().ToString()

32 digits separated by hyphens 

00000000-0000-0000-0000-000000000000

 System.GUID.NewGuid().ToString("B")

32 digits separated by hyphens, enclosed in braces:

{00000000-0000-0000-0000-000000000000}  

 System.GUID.NewGuid().ToString("P")

32 digits separated by hyphens, enclosed in parentheses:

(00000000-0000-0000-0000-000000000000) 

 System.GUID.NewGuid().ToString("N")

32 digits:

00000000000000000000000000000000  

 System.GUID.NewGuid().ToString("X")

Four hexadecimal values enclosed in braces, where the fourth value is a

subset of eight hexadecimal values that is also enclosed in braces:

{0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}} 

 System.GUID.NewGuid().ToString("D")

32 digits separated by hyphens:

00000000-0000-0000-0000-000000000000