Random number In C#
See the question and my original answer on StackOverflowMake the Random instance static:
static Random rndNumber = new Random((int)DateTime.Now.Ticks);
public static int SelectRandomMachine(int max)
{
int randMachine = rndNumber.Next(0, max);
return randMachine;
}