What are you trying to achieve? Because the code you have posted does not fit together - the three parts are separate, odd, and don't appear to work.
For example, the random number function is really useless:
public static int RandNumber()
{
Random randomNumber = new Random();
int RN = randomNumber.Next(23,26);
return RN;
}
If you call this several times in quick succession, you will almost certainly get the same number. Move you random number generator to a class level variable instead:
Random randomNumber = new Random();
public static int RandNumber()
{
return randomNumber.Next(23,26);
}
Which almost asks "why have it as a separate method at all?"
Plus, don't use "magic numbers" in you code - convert them to
const
values with sensible names instead. That way, if they need to change, you only have to change them in one place.
Your other method is equally odd: I don't think you have thought about your task in any detail.