/// <summary> /// Get a random string with especified characters with specified style and lenght /// </summary> /// <param name="Style">Style of string return</param> /// <param name="Lenght">Number of characters to string return</param> /// <returns>String alphanumeric</returns> public static string NextString(eStringStyle Style, int Lenght) { string result = string.Empty; for (int i = 0; i < Lenght; i++) { switch (Style) { case eStringStyle.Normal: result += CHARS[Next(CHARS.Length)].ToString(); break; case eStringStyle.Lower: result += CHARS[Next(CHARS.Length)].ToString().ToLower(); break; case eStringStyle.Upper: result += CHARS[Next(CHARS.Length)].ToString().ToUpper(); break; } } return(result); }
/// <summary> /// Get a random string with 8 characters with specified style /// </summary> /// <param name="Style">Style of string return</param> /// <returns>String alphanumeric</returns> public static string NextString(eStringStyle Style) { return(NextString(Style, DEFAULT_LENGTH)); }