user209309
user209309

Reputation:

how to create GUID?

how to create GUID in asp.net 3.5?

Upvotes: 8

Views: 16595

Answers (3)

Thulani Chivandikwa
Thulani Chivandikwa

Reputation: 3539

Something else that may be nice to know along with guids is how to set the format of the guid string

' plain with nothing added

Console.Writeline(System.Guid.NewGuid().ToString("N"))

'with delimeter (-)/default 

Console.Writeline(System.Guid.NewGuid().ToString("D"))

'default with brackets

Console.Writeline(System.Guid.NewGuid().ToString("B"))

'default with paranthesis

Console.Writeline(System.Guid.NewGuid().ToString("P"))

Upvotes: 5

Ryan Cook
Ryan Cook

Reputation: 9335

System.Guid.NewGuid()

The complete doc is here: http://msdn.microsoft.com/en-us/library/system.guid.aspx

Upvotes: 23

marcc
marcc

Reputation: 12399

System.Guid.NewGuid()

Upvotes: 4

Related Questions