C#产生自定义Guid参数

        public string GetGuid()
        {
            string[] arr=new string[]{"1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g"};
            string str1 = DateTime.Now.ToString("yyyyMMdd");
            string str2 = "";

            Random ran = new Random();
            for (int i = 0; i < 12; i++)
            {
                str2+=arr[ran.Next(0, 16)];
            }

            return str1 + str2;
        }

该Guid由时间+12位16进制数组成

记录编程的点滴,体会学习的乐趣
原文地址:https://www.cnblogs.com/AduBlog/p/14296585.html