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(); rand.Next();