GUID 是微软对UUID这个标准的实现。UUID是由开放软件基金会(OSF)定义的。UUID还有其它各种实现,不止GUID一种
public string ToString(
string format
)
The format parameter can be "N", "D", "B", "P", or "X". if format is null or an empty string (""), use "D"
The following table shows the format specifier that is accepted as the formatting parameter. " 0" denotes a number; the hyphen ("-"), the curly brace ("{", "}"), and the Parentheses ("(", ")") are shown below.
Specifiers |
Format of the return value |
N |
32-digit number: 00000000000000000000000000000000 |
D |
32-digit number separated by hyphens: 00000000-0000-0000-0000-000000000000 |
B |
32 digits separated by hyphens, enclosed in curly braces: {00000000-0000-0000-0000-000000000000} |
P |
A 32-digit number separated by a hyphen enclosed in parentheses: (00000000-0000-0000-0000-000000000000) |
X |
Four hexadecimal values are enclosed in curly braces, where the fourth value is also a subset of the eight hexadecimal values enclosed in curly braces: {0x00000000, 0x0000, 0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00}} |
The hexadecimal digits A through F are lowercase in the returned string. to convert them to uppercase, call the string returned by the Stringtoupper method.
Generation format of GUIDs in C # (Guid.tostring method)