In order to generate a random number between two numbers, use the Next Function of the Random class as shown below:

Example :

To simulate a roll of a dice, we would need to generate a random integer between 1 and 6 (6 not included).

Random random = new Random();
int randomNumber = random.Next(1, 6);