public string GetMsgID()
{
Random rand = new Random((int)DateTime.Now.Ticks);
string szRand = rand.Next(0, 9999).ToString().PadLeft(4, '0');
return string.Format("{0}{1}", DateTime.Now.ToString("yyyyMMddHHmmss"), szRand);
}
本文共 301 字,大约阅读时间需要 1 分钟。
public string GetMsgID()
{
Random rand = new Random((int)DateTime.Now.Ticks);
string szRand = rand.Next(0, 9999).ToString().PadLeft(4, '0');
return string.Format("{0}{1}", DateTime.Now.ToString("yyyyMMddHHmmss"), szRand);
}
转载于:https://www.cnblogs.com/zuifengke/p/dd8a349559231a138661a1b9bcdf1975.html