CSharp examples for System:Random
Generate Random Number
using System.Threading.Tasks; using System.Text; using System.Linq; using System.Collections.Generic; using System;/*from w w w. j a v a2s . c o m*/ public class Main{ public static string GenerateNumber(int n) { StringBuilder builer = new StringBuilder(); Random rd = new Random(); for (int i = 0; i < n; i++) builer.Append(constant[rd.Next(10)]); return builer.ToString(); } }