How do I seed a random class to avoid getting duplicate random values

Viewed 211755

I have the following code inside a static method in a static class:

Random r = new Random();
int randomNumber = r.Next(1,100);

I have this inside a loop and I keep getting the same randomNumber!

Any suggestions here?

8 Answers
Related