C#获取随机数,真正的随机数
2021-06-20 10:13
标签:获取 next response new write eth ISE ++ hashcode //亲测无问题 C#获取随机数,真正的随机数 标签:获取 next response new write eth ISE ++ hashcode 原文地址:https://www.cnblogs.com/webapi/p/10261576.html byte[] buffer = Guid.NewGuid().ToByteArray();
int iSeed = BitConverter.ToInt32(buffer, 0);
Random random = new Random(iSeed);
//Random random = new Random(new Guid().GetHashCode());//也有人用这种写法,这种写法是有问题的,不信请测试
for (int i = 0; i 100; i++)
{
Response.Write(random.Next(0, 100) + "
");
}