Random rnd = new Random(DateTime.Now.Millisecond); int min = 0; int max = 100; int random = Convert.ToInt32(rnd.Next(min, max));