System.Guid.NewGuid (). The ToString () Global Unique identifier (GUID) is an alphanumeric identifier that indicates the uniqueness of the product identity
Public string ToString ( string format)
Parameters
-
- Format
-
Type: System . String
A single-format specifier that indicates how to format thisThe value of the guid . format parameter can be "n","d", "b","p", or & quot X". " The >format parameter can be "N", "D", "B", "P" or "X". format is null or an empty string (" "),"D"is used." > if format for or an empty string (""), use "D".
Return value type: System. String
the value of this Guid, expressed in a series of lowercase hexadecimal bits in the specified format.
The following table shows the format specifiers that are accepted by the format parameter. "0" represents a number; the hyphen ("-"), curly braces ("{", "}"), and parentheses ("(", ")") are displayed as shown below.
Specifiers |
Format of the return value |
N |
32-bit: 00000000000000000000000000000000 |
D |
32-digit number separated by hyphens: 00000000-0000-0000-0000-000000000000 |
B |
32-bit numbers enclosed in curly braces, separated by hyphens: {00000000-0000-0000-0000-000000000000} |
p |
(00000000-0000-0000-0000-000000000000) |
X |
4 hexadecimal values enclosed in curly braces, where the 4th value is a subset of 8 hexadecimal values (also enclosed in curly braces): {0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}} |
The hexadecimal digits A through F are examples in the returned string. to convert them to uppercase, call the string in the returned strings . ToUpper method.
Guid.NewGuid (). Several formats for ToString ()