code block for genreating randon string from a fixed set of chars.

public string GenerateRandomString()
var charsToChooseFrom = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
      var length = 50;
      var random = new Random();
      var randomString = new string(
       Enumerable.Repeat(charsToChooseFrom, length)
                          .Select(t => t[random.Next(t.Length)])

      return randomString;
6 - 1 =
** To prevent abusing comments from publishing, posted comments will be reviewed and then published!
 Mritunjay Kumar
Works at Mindfire Solutions

I mostly work with C#, ASP.NET, MVC, WCF, Web API, Entity FrameWork, MS Sql.

More under this category...
Convert data table to generic list
Extension method to convert a delimited string to list of generic primitive type
Convert generic list to data table
Google cloud storage API - Rename a file
Initializing X509Certificate2, Windows 2012 + IIS8 + .Net 4.5
Google cloud storage API - upload file with progress bar
Google cloud storage API - download file with progress bar
All under this category...