SourceCode/RFrameGenerate.Common/CodeManage.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RFrameGenerate.Common
{
    /// <summary>
    /// 唯一编号
    /// </summary>
    public class CodeManage
    {
        public static string GetOrderNO()
        {
            int id = System.Threading.Thread.CurrentThread.ManagedThreadId;
            DateTime dt = DateTime.Now;
            string strid = string.Format("{0:D4}", id);

            if (strid.Length > 4)
                throw new Exception("现在下单人数较多,请稍候再试.");

            string no = dt.ToString("yyMMdd#4ffff#3HH#2mm#1ss");//20
            no = no.Replace("#1", strid[strid.Length - 1].ToString());
            no = no.Replace("#2", strid[strid.Length - 2].ToString());
            no = no.Replace("#3", strid[strid.Length - 3].ToString());
            no = no.Replace("#4", strid[strid.Length - 4].ToString());
            System.Threading.Thread.Sleep(10);
            return no;
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。