[Serializable] |
ctor #1 | Overloaded:.ctor(byte[] b) Initializes a new instance of the Guid class using the specified array of bytes. |
ctor #2 | Overloaded:.ctor(string g) Initializes a new instance of the Guid class using the value represented by the specified string. |
ctor #3 | Overloaded:.ctor(int a, short b, short c, byte[] d) Initializes a new instance of the Guid class using the specified integers and byte array. |
ctor #4 | Overloaded:.ctor(int a, short b, short c, byte d, byte e, byte f, byte g, byte h, byte i, byte j, byte k) Initializes a new instance of the Guid class using the specified integers and bytes. |
ctor #5 | Overloaded:.ctor(uint a, ushort b, ushort c, byte d, byte e, byte f, byte g, byte h, byte i, byte j, byte k) Initializes a new instance of the Guid class using the specified unsigned integers and bytes. |
CompareTo | Compares this instance to a specified object and returns an indication of their relative values. |
Equals | Overridden: Returns a value indicating whether this instance is equal to a specified object. |
GetHashCode | Overridden: Returns the hash code for this instance. |
GetType (inherited from System.Object) |
See base class member description: System.Object.GetType Derived from System.Object, the primary base class for all objects. |
NewGuid | Initializes a new instance of the Guid class. |
ToByteArray | Returns a 16-element byte array that contains the value of the GUID. |
ToString | Overloaded:ToString() Overridden: Returns a String representation of the value of this instance in Registry format. |
ToString | Overloaded:ToString(string format) Returns a String representation of the value of this Guid instance, according to the provided format specifier. |
ToString | Overloaded:ToString(string format, IFormatProvider provider) Returns a String representation of the value of this instance of the Guid class, according to the provided format specifier and culture-specific format information. |
op_Equality | Returns an indication whether the values of two specified Guid objects are equal. |
op_Inequality | Returns an indication whether the values of two specified Guid objects are not equal. |
Finalize (inherited from System.Object) |
See base class member description: System.Object.Finalize Derived from System.Object, the primary base class for all objects. |
MemberwiseClone (inherited from System.Object) |
See base class member description: System.Object.MemberwiseClone Derived from System.Object, the primary base class for all objects. |
Hierarchy:
public Guid( |
b
Exception Type | Condition |
---|---|
ArgumentNullException | b is null. |
ArgumentException | b is not 16 bytes long. |
public Guid( |
g
Alternatively, the following format is permitted: {0xdddddddd,0xdddd, 0xdddd,{0xdd},{0xdd},{0xdd},{0xdd},{0xdd},{0xdd},{0xdd},{0xdd}}, where d is a hexadecimal digit. If this format is used, all brackets and commas indicated are required, and all numbers must be prefixed with "0x" as shown. Fewer hexadecimal digits than shown can be used, but no more.
A String that contains a GUID in the following format: hexadecimal digits are arranged in groups of 8, 4, 4, 4, and 12 digits with hyphens between the groups. The GUID can optionally be enclosed in matching braces. For example: dddddddd-dddd-dddd-dddd-dddddddddddd or {dddddddd-dddd-dddd-dddd-dddddddddddd}.Alternatively, the following format is permitted: {0xdddddddd,0xdddd, 0xdddd,{0xdd},{0xdd},{0xdd},{0xdd},{0xdd},{0xdd},{0xdd},{0xdd}}, where d is a hexadecimal digit. If this format is used, all brackets and commas indicated are required, and all numbers must be prefixed with "0x" as shown. Fewer hexadecimal digits than shown can be used, but no more.
Exception Type | Condition |
---|---|
ArgumentNullException | g is null. |
FormatException | The length of g is invalid. The length should be 38 if(-)'{' and(-)'}' are used, and 36 otherwise (counting digits and dashes). The first (or last) character in g is(-)'{' but the last (or first) character is not(-)'}'. g contains(-)'-' in the wrong places. The expected format is 8 hexadecimal digits followed by a dash, followed by 4 digits then a dash, followed by 4 digits then a dash, followed by 4 digits then a dash, followed by 12 digits. g contains improperly grouped hexadecimal digits. The expected format is 8 hexadecimal digits followed by a dash, followed by 4 digits then a dash, followed by 4 digits then a dash, followed by 4 digits then a dash, followed by 12 digits. An element in g does not represent a valid hexadecimal number. |
"CA761232-ED42-11CE-BACD-00AA0057B223"
or
"{CA761232-ED42-11CE-BACD-00AA0057B223}"
a
b
c
d
Exception Type | Condition |
---|---|
ArgumentNullException | d is null. |
ArgumentException | d is not 8 bytes long. |
Guid(1,2,3,new byte[]{0,1,2,3,4,5,6,7})
creates a Guid that corresponds to "00000001-0002-0003-0001-020304050607".
public Guid( |
a
b
c
d
e
f
g
h
i
j
k
Guid(0xa,0xb,0xc,0,1,2,3,4,5,6,7)
creates a Guid that corresponds to "0000000a-000b-000c-0001-020304050607".[CLSCompliant(false)] |
a
b
c
d
e
f
g
h
i
j
k
public static readonly Guid Empty;
|
value
Value | Description |
---|---|
A negative integer | This instance is less than . |
Zero | This instance is equal to . |
A positive integer | This instance is greater than value. -or- value is null. |
Exception Type | Condition |
---|---|
ArgumentException | value is not a Guid. |
value must be null or an instance of Guid; otherwise, an exception is thrown.
o
~Guid(); |
public override int GetHashCode(); |
public Type GetType(); |
protected object MemberwiseClone(); |
public static Guid NewGuid(); |
a
b
a
b
public byte[] ToByteArray(); |
public override string ToString(); |
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
where the value of the GUID is represented as a series of lower-case hexadecimal digits in groups of 8, 4, 4, 4, and 12 digits and separated by hyphens. An example of a return value is "382c74c3-721d-4f34-80e5-57657b6cbc27".
format
Specifier | Format of Return Value |
---|---|
N | 32 digits: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
D | 32 digits separated by hyphens: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
B | 32 digits separated by hyphens, enclosed in brackets: {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} |
P | 32 digits separated by hyphens, enclosed in parentheses: (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) |
public string ToString( |
format
provider
Exception Type | Condition |
---|---|
FormatException | The value of format is not "N", "D", "B", or "P". |
Specifier | Format of Return Value |
---|---|
N | 32 digits: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
D | 32 digits separated by hyphens: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
B | 32 digits separated by hyphens, enclosed in brackets: {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} |
P | 32 digits separated by hyphens, enclosed in parentheses: (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) |
If format is null or the empty string, the 'N' format specifier is assumed.
The provider parameter is reserved for future use and does not contribute to the execution of this method. A null reference can be coded for this parameter.