Create an instance of a random number generator: –

Random rnd = new Random();

Grab random numbers from it as required using: –

int i = rnd.Next(1, 100);

double d = rnd.NextDouble();

The latter will give a value between 0.0 and 1.0