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