What is GUID , why we use it?,how to create a GUID

1. GUID is Short form of Globally Unique Identifier, a unique 128-bit number that is produced by the Windows OS or by some Windows applications to identify a particular component, application, file, database entry, and/or user.

2. For instance, a Web site may generate a GUID and assign it to a user's browser to record and track the session.

3. A GUID is also used in a Windows registry to identify COM DLLs.

4. Knowing where to look in the registry and having the correct GUID yields a lot information about a COM object (i.e., information in the type library, its physical location, etc.).

5. Windows also identifies user accounts by a username (computer/domain and username) and assigns it a GUID.

6. Some database administrators even will use GUIDs as primary key values in databases.

7. GUIDs can be created in a number of ways, but usually they are a combination of a few unique settings based on specific point in time (e.g., an
IP address, network MAC address, clock date/time, etc.).

Here i am showing how to create a GUID in c#?

Guid id = Guid.NewGuid();

Console.WriteLine(id); // Outputs "8c1d1c4b-df68-454c-bf30-953e5701949f"


Tags: ,

Join Us!