c# - GUID 的格式是否始终相同?

标签 c# string guid

GUID 你得到类似 aaaef973-d8ce-4c92-95b4-3635bb2d42d5 的东西

总是一样吗?它是否总是具有以下格式

8个字符“-”、4个字符“-”、4个字符“-”、4个字符“-”、12个字符

我问是因为我需要将不带“-”的 GUID 转换为带“-”的 GUID 和副签证。

最佳答案

没有;还有其他格式,例如您列出的格式,但大括号除外。还有更复杂的格式。以下是 MSDN 列出的一些格式:

UUID formats

  • 32 digits: 00000000000000000000000000000000 (N)
  • 32 digits separated by hyphens: 00000000-0000-0000-0000-000000000000 (D)
  • 32 digits separated by hyphens, enclosed in braces: {00000000-0000-0000-0000-000000000000} (B)
  • 32 digits separated by hyphens, enclosed in parentheses: (00000000-0000-0000-0000-000000000000) (P)
  • Four hexadecimal values enclosed in braces, where the fourth value is a subset of eight hexadecimal values that is also enclosed in braces: {0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}} (X)

MSDN

关于c# - GUID 的格式是否始终相同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7775439/

相关文章:

php - 是否有转换这些字符的 php 函数?

java - 如何在 Python 中生成 long 类型的 UUID(由 java 程序使用)?

c# - 重新 :test() XPath to HtmlAgilityPack (get all p tags with matched regex internal)

c# - 是否可以通过 Wcftest 客户端测试 WCF throttle 行为?

c - 在C语言的.text文件中读取“;”之间的字符串

javascript - 如何从 $(...).html() 方法给出的多行字符串中删除缩进

asp.net - 为什么 aspnet_users 使用 guid 作为 id 而不是递增 int?帮助扩展用户字段的奖励积分

.net - GUID 的不可猜测性如何?

c# - 调整 Silverlight 数据网格行的单元格高度?

c# - SQL Server 查询 : Get a List of Columns Which Don't Exist in Another Table's Field