C#生成手机号,用做用户名,爬虫利器,哈哈
public static string getRandomPhone() { string res = ""; string[] carrier = { "133", "149","177", "189", "199", "130", "131", "132", "145", "156", "185", "186" , "135","136","137","138","139","182","188"};//随便搞了几个号段,有需要自己修改哦 Random crm = new Random((int)DateTime.Now.Ticks); Random hrm = new Random((int)DateTime.Now.Ticks); int cindex = crm.Next(0, carrier.Length - 1); res += carrier[cindex]; res += "****"; res += hrm.Next(1234, 9999).ToString() ; return res; }
微信扫码查看本文
发表评论