您需要保留相同的
Random对象。将其作为静态成员放在静态方法之外
private static Random rand = new Random();public static int rInt(int exclUB, int incLB = 0){ int t = rand.Next(incLB, exclUB); return t;}编辑
原因是用于初始化的时钟的有限分辨率
Random。随后的Random初始化将在随机序列中获得相同的起始位置。当重复使用相同的Random时,总是会生成随机序列中的下一个值。


![随机数生成-返回相同的数字[重复] 随机数生成-返回相同的数字[重复]](http://www.mshxw.com/aiimages/31/390675.png)
