利用Guid类生成唯一ID

作者:追风剑情 发布于:2016-9-22 19:41 分类:C#

using System;

namespace TTest
{
    class Program
    {
        static void Main(string[] args)
        {
            for (int i = 0; i < 100; i++)
            {
                Guid guid = Guid.NewGuid();
                //支持的参数格式化ToString("N"), "B", "P", "X"
                Console.WriteLine(guid.ToString());
            }
            Console.Read();
        }
    }
}

 

运行测试

11111.png

 

标签: C#

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号