For starters, don't do it like that: each time you call that method, it creates a new random number and seeds it from the system clock. Unless you have a very slow processor, that means that if you call that method several times in quick succession, you will get the same random number sequence from each - which is not random!
Move the Random instance outside the method and it should start to work better:
private Random random = new Random();
private int RandomNumber(int min, int max)
{
return random.Next(min, max);
}
If that doesn't fix your problem, you will have to explain in much better detail exactly what you are trying to do - your description is very vague and brief, and we cannot work out from that little what you are trying to do. Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.