December 12, 2007

Globally Unique Identifier (GUID) in .NET

Guid: Globally Unique Identifier, Return a unique identifier with the method of newGuid(). which is mostly used to generate random passwords, and maintaining sessions.

Code:

VB.NET
Dim randomNo as String = System.Guid.NewGuid().ToString()

C#
string randomNo = System.Guid.NewGuid().ToString();

No comments:

Post a Comment