#region 生成随机数 /// <summary> /// /// </summary> private static int iCount; /// <summary> /// 生成随机数 /// </summary> /// <returns></returns> public static string GenerateRandomNumber() { System.Threading.Interlocked.Increment(ref iCount); Random rnd = new Random(Guid.NewGuid().GetHashCode()); return iCount.ToString().PadRight(4, '0') + rnd.Next(1, 10000).ToString().PadLeft(4, '0'); } #endregion