Globally Unique Identifier System.Guid.NewGuid (). ToString ()

System.Guid.NewGuid () ToString ();. // ToString () is a null or empty string ( ""), the use of "D".
The results: 820941e4-3dd5-4835-b67a-b19b208428cc

. System.Guid.NewGuid () ToString ( "N "); // 32 Bit: 00000000000000000000000000000000
Results: 309d5008977f4daeb6a1fda3b1942b71

. System.Guid.NewGuid () ToString ( "D "); // separated by a hyphen 32-bit numbers: 00000000-0000-0000-0000-000000000000
Results: 5e1377fe-a5e1-4346-8146-3748108b0efd

. System.Guid.NewGuid () ToString ( "B "); // enclosed in braces, separated by a hyphen 32-bit numbers: {} 00000000-0000-0000-0000-000000000000
Results: {ca1fd426-f52f- 41b6-8a54-01240edd8939}

System.Guid.NewGuid () ToString ( "P" ); // enclosed in parentheses, separated by a hyphen 32-bit numbers: (00000000-0000-0000-0000-000000000000)
Results: (b443153c-4171- 4a40-8851-4cd989b314d5)

System.Guid.NewGuid () ToString ( "X" );. // enclosed in braces hexadecimal value 4, wherein the fourth value is a subset of 8 hexadecimal values (also included in braces): {0x00000000,0x0000,0x0000, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00} }
results: {0xee3ae5ac, 0xd99f, 0x421f, {0x87,0xec, 0xab, 0x02,0xbc, 0xaa, 0x1e, 0x87}}

In addition to records about the D and N other often forget what way

Guess you like

Origin www.cnblogs.com/skyapplezhao/p/11547177.html