maztt maztt - 5 months ago 58
C# Question mvc c# random generating same number

how can i generate different number,it is generating the same number

Random rand = new Random(100000);


Just remove the seed number in the constructor. This seed is essentially a number from which the random number list is generated. If you specify a constant number, your random number list will always be the same.

Random rand = new Random();