/// <summary>
/// 解决伪随机问题
/// </summary>
public static void Random()
{
int t = 0;
for (int i = 0; i < 10; i++)
{
byte[] bytes = new byte[4];
System.Security.Cryptography.RNGCryptoServiceProvider rng = new System.Security.Cryptography.RNGCryptoServiceProvider();
rng.GetBytes(bytes);
t = BitConverter.ToInt32(bytes, 0);
Random rnd = new Random(t);
Console.WriteLine(rnd.Next(0, 10));
}
}

 

相关文章:

  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2021-07-19
猜你喜欢
  • 2022-12-23
  • 2021-06-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
  • 2022-01-03
相关资源
相似解决方案