System.Guid.NewGuid Method

Initializes a new instance of the Guid structure.

Syntax

public static Guid NewGuid ()

Returns

A new GUID object.

Remarks

This is a convenient static method that you can call to get a new Guid.

The chance that the value of the new Guid will be all zeros or equal to any other Guid is very low. You can determine whether a GUID consists of all zeros by comparing it to Guid.Empty.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0