Share via


Guid Structure

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Represents a globally unique identifier (GUID).

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
<SerializableAttribute> _
Public Structure Guid
[SerializableAttribute]
public struct Guid
[SerializableAttribute]
public value class Guid
[<Sealed>]
[<SerializableAttribute>]
type Guid =  struct end
JScript supports the use of structures, but not the declaration of new ones.

The Guid type exposes the following members.

Constructors

  Name Description
Public method Guid(array<Byte> [] () [] []) Initializes a new instance of the Guid structure by using the specified array of bytes.
Public method Guid(Int32, Int16, Int16, Byte, Byte, Byte, Byte, Byte, Byte, Byte, Byte) Initializes a new instance of the Guid structure by using the specified integers and bytes.
Public method Guid(UInt32, UInt16, UInt16, Byte, Byte, Byte, Byte, Byte, Byte, Byte, Byte) Initializes a new instance of the Guid structure by using the specified unsigned integers and bytes.

Top

Methods

  Name Description
Public method CompareTo Compares this instance to a specified object and returns an indication of their relative values.
Public method Equals Returns a value that indicates whether this instance is equal to a specified object. (Overrides ValueType. . :: . .Equals(Object).)
Public method GetHashCode Returns the hash code for this instance. (Overrides Object. . :: . .GetHashCode() () () ().)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public methodStatic member NewGuid Initializes a new instance of the Guid structure.
Public method ToByteArray Returns a 16-element byte array that contains the value of this instance.
Public method ToString Returns a string representation of the value of this instance in registry format. (Overrides Object. . :: . .ToString() () () ().)

Top

Fields

  Name Description
Public fieldStatic member Empty A read-only instance of the Guid structure whose value is all zeros.

Top

Remarks

A GUID is a 128-bit integer (16 bytes) that can be used across all computers and networks wherever a unique identifier is required. Such an identifier has a very low probability of being duplicated.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System Namespace