C# System.Guid.NewGuid()

概念

GUID: 即Globally Unique Identifier(全球唯一标识符) 也称作 UUID(Universally Unique IDentifier) 。 GUID是一个通过特定算法产生的二进制长度为128位的数字标识符,用于指示产品的唯一性。GUID 主要用于在拥有多个节点、多台计算机的网络或系统中,分配必须具有唯一性的标识符。
在 Windows 平台上,GUID 广泛应用于微软的产品中,用于标识如如注册表项、类及接口标识、数据库、系统目录等对象。

格式

GUID
的格式为“xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”,其中每个 x 是 0-9 或 a-f
范围内的一个32位十六进制数。例如:6F9619FF-8B86-D011-B42D-00C04FC964FF 即为有效的 GUID 值。

System.Guid.NewGuid().ToString("N");        32位字符串

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

System.Guid.NewGuid().ToString("D");        连字符分隔的32位字符串

xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

System.Guid.NewGuid().ToString("B");        在大括号中、由连字符分隔的32位字符串

{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}

System.Guid.NewGuid().ToString("P");        在圆括号中、由连字符分隔的32位字符串

(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

问题:System.Guid.NewGuid();结果:C# System.Guid.NewGuid()的更多相关文章

  1. 异常:System.Runtime.InteropServices.Marshal.GetTypeFromCLSID(System.Guid)

    异常:System.Runtime.InteropServices.Marshal.GetTypeFromCLSID(System.Guid) 原因:该引用所需.NET Framework版本为4.5 ...

  2. NotSupportedException-无法将类型“System.DateTime”强制转换为类型“System.Object”

    几张图就可以说明一切 2015-03-29 21:54:09,206 [77] ERROR log - System.NotSupportedException: 无法将类型“System.DateT ...

  3. System.Net.Sockets.Socket SendAsync System.ObjectDisposedException: Cannot access a disposed object.

    发生未处理的域异常! System.ObjectDisposedException: Cannot access a disposed object. Object name: 'System.Net ...

  4. 详解C#中System.IO.File类和System.IO.FileInfo类的用法

    System.IO.File类和System.IO.FileInfo类主要提供有关文件的各种操作,在使用时需要引用System.IO命名空间.下面通过程序实例来介绍其主要属性和方法. (1) 文件打开 ...

  5. 【C#遗补】获取应用程序路径之System.IO.Directory.GetCurrentDirectory和System.Windows.Forms.Application.StartupPath的区别

    原文:[C#遗补]获取应用程序路径之System.IO.Directory.GetCurrentDirectory和System.Windows.Forms.Application.StartupPa ...

  6. Web Service接口返回泛型的问题(System.InvalidCastException: 无法将类型为“System.Collections.Generic.List`1[System.String]”的对象强制转换为类型“System.String[]”)

    在使用C#写Web Service时遇到了个很奇怪的问题.返回值的类型是泛型(我用的是类似List<string>)的接口,测试时发现总是报什么无法转换为对象的错误,百思不得其解. 后来在 ...

  7. Unable to chmod /system/build.prop.: Read-only file system

    Unable to chmod /system/build.prop.: Read-only file system 只读文件系统 所以需要更改 使用下面的命令 mount -o remount,rw ...

  8. 在SD/MMC卡上实现hive (Implement WinCE HIVE&ROM system on NAND or SD system )

    本是个很简单的topic,但无奈的是很多客户都没有实现.所以只能写一个guide给客户,让他们依葫芦画瓢. 在SD卡上实现hive以及实现binfs最精髓的思想是,在boot stage 1依次加载s ...

  9. 异常:unity3d ArgumentException: The Assembly System.Configuration is referenced by System.Data.

    异常:ArgumentException: The Assembly System.Configuration is referenced by System.Data. But the dll is ...

  10. Jexus .Net at System.Net.Sockets.Socket.Connect (System.Net.IPAddress[] addresses, System.Int32 port)

    环境:Jexus(独立版)+MVC(5.2.3) +Redis+EF(6.0) Application Exception System.Net.Sockets.SocketException Con ...

随机推荐

  1. hdu 5147 Sequence II 树状数组

    Sequence II Time Limit: 5000/2500 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Prob ...

  2. FMX.TTabControl_多行

    1. 重载 TTabControl.RealignTabs; 2. 3.

  3. keystone uwsgi failed

    ~$ /usr/local/bin/uwsgi /etc/keystone/keystone-uwsgi-public.ini[uWSGI] getting INI configuration fro ...

  4. eclipse下进行c开发,使用zeromq

    使用eclipse开发代码,一段zeromq的代码. #include <string.h> #include <stdio.h> #include <unistd.h& ...

  5. Android开源项目-Easypermissions

    Easypermissions简化了Android M的运行时权限的申请.结果处理.判断等步骤. 1 相关文档 官方文档: https://github.com/googlesamples/easyp ...

  6. php get_magic_quotes_gpc()

    magic_quotes_gpc函数在php中的作用是判断解析用户输入的数据,如包括有:post.get.cookie过来的数据增加转义字符“\”,以确保这些数据不会引起程序异常,特别是数据库语句因为 ...

  7. liunx常用命令-----查找命令

    locate 根据文件名查找文件 根据数据库记录搜索,当天创建的搜不到 whereis which  搜索命令的命令   如 whereis ls find   /root   -name       ...

  8. HANA Architecture

    1 HANA 是基于内存计算的.行列都支持.使用列存储,列存储的特点是高压缩,查询快,节约空间, ---SAP HANA supports both, but is particularly opti ...

  9. 总结js创建object的方式(对象)

    1.使用new操作符后跟Object构造函数 如: var person = new Object(); 可以写成 var person = {}; person.name = "kitty ...

  10. OOP思想应该怎样来理解?

    https://blog.csdn.net/qq157962718/article/details/50990154 https://www.cnblogs.com/xiaosongluffy/p/5 ...