CSharp examples for System:Random
Get Random String for size
using System.Text; using System.Linq; using System.Collections.Generic; using System;/*from ww w . j a va2s . c om*/ public class Main{ public static string GetRandomString(int size) { const string chars = "ABCDEFGHIJKLMNOPRSTUVWXYZabcdefghijklmnoprstuvwxyz0123456789"; var buffer = new char[size]; for (int i = 0; i < size; i++) buffer[i] = chars[_random.Next(chars.Length)]; return new string(buffer); } }