Possible Duplicate:
Random number generator not working the way I had planned (C#)
I have this code in c# but I get a result the same number, what is it wrong?
like a21, a21, a21....
String c = "";
int randomNumber = 0;
for (int i = 0; i < 20; i++)
{
randomNumber = RandomNumber(0, 617);
c += "a " + randomNumber + ", ";
}
file.WriteLine(c);
I am using this function
public static int RandomNumber(int min, int max)
{
Random random = new Random();
return random.Next(min, max);
}