Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 25th, 2012  |  syntax: None  |  size: 0.51 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.         /// <summary>
  2.         /// Generates a random string of nonsense.
  3.         /// </summary>
  4.         /// <param name="length">The length of the string to generate.</param>
  5.         /// <returns></returns>
  6.         private string RandomString(int length)
  7.         {
  8.             return new string(
  9.                 Enumerable.Repeat("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", length)
  10.                           .Select(s => s[_rnd.Next(s.Length)])
  11.                           .ToArray());
  12.         }