CSharp examples for System:Random
Get Random Number
using System.Web; using System.Collections.Generic; using System;//from w ww.j av a2 s . c om public class Main{ public static string GetRandNumber(int lenght) { string randNumber = ""; var ra = new Random(); for (int i = 0; i < lenght; i++) { randNumber += (ra.Next(1,10) - 1).ToString(); } return randNumber; } }