CSharp examples for System:Random
Random Number by size
using System.IO;/*from w w w.jav a 2 s .c o m*/ using System.Collections; using System.Text; using System.Linq; using System.Collections.Generic; using System; public class Main{ public static string RandomNumber(int size) { Random _rng = new Random(); char[] buffer = new char[size]; for (int i = 0; i < size; i++) { buffer[i] = _Numbers[_rng.Next(_Numbers.Length)]; } return new string(buffer); } }