生成真随机数
//获取len位真随机数字(真随机数) public static string GetRealRandomNum(int len) { var sb = new StringBuilder(); byte[] data = new byte[len]; using (var provider = new RNGCryptoServiceProvider()) { provider.GetBytes(data); foreach (byte item in data) { string temp = (item % 10).ToString(); sb.Append(temp); } } return sb.ToString(); }