/************************************************************* (C) ISEP 2003, 2004 (C) Laboratório .net DEI/ISEP 2003, 2004 O ISEP, na qualidade de autor do presente software, garante o direito de utilização, alteração, evolução e distribuição do mesmo sem qualquer tipo de restrições, excepto: - esta mensagem não pode ser retirada - os nomes das classes não podem ser alterados *************************************************************/ using System; namespace Isep.Util { /// /// Summary description for StringUtil. /// public class StringHelper { private const string CHARSET = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; public static string GenerateRandomString(int len) { Random rnd = new Random(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); for (int i = 0; i < len; i++) { int c = rnd.Next(CHARSET.Length); sb.Append(CHARSET[c]); } return sb.ToString(); } } }