Ejemplo n.º 1
0
Archivo: Sfz.cs Proyecto: cnucky/huan
        /// <summary>
        /// 生成一个随机身份证
        /// </summary>
        /// <returns>一个身份证</returns>
        public static ShenFenZheng ProduceShenFenZheng()
        {
            uint     code     = uint.Parse(RandomManager.RandomReadOneLine("config//shenfenzheng1.txt"));
            DateTime birthDay = new DateTime(new Random().Next(1970, 1994),
                                             new Random().Next(1, 12), new Random().Next(1, 28));
            ushort orderID = (ushort)new Random().Next(0, 999);

            return(new ShenFenZheng(code, birthDay, orderID));
        }
Ejemplo n.º 2
0
 public static string ReplaceNum(this string str)
 {
     if (str.Contains("{两位数字}"))
     {
         str = str.Replace("{两位数字}", RandomManager.GetZero2Nine() + RandomManager.GetZero2Nine());
     }
     if (str.Contains("{一位数字}"))
     {
         str = str.Replace("{一位数字}", RandomManager.GetZero2Nine());
     }
     return(str);
 }
Ejemplo n.º 3
0
        public static void WriteHaoZi(string msg, string filname)
        {
            string path = "import//" + filname;

            if (File.Exists(path))
            {
                File.Move(path, "import//" + filname + "{0}.txt".With(RandomManager.GetDateTimeString()));
            }

            using (StreamWriter sw = File.CreateText(
                       "import//" + filname
                       )) {
                sw.Write(msg);
                sw.Close();
            }
        }
Ejemplo n.º 4
0
 public static string getPwd()
 {
     return(RandomManager.ProduceRandomStr(3, 5, RandomManager.zimu24.ToArray()) +
            RandomManager.ProduceRandomStr(3, 5, RandomManager.Zero2Nine.ToArray()) +
            RandomManager.ProduceRandomStr(1, 5, RandomManager.Zero2Nine.ToArray()));
 }