public static string GetRandomString(int iLength) { ";// 随机字符中也可以为汉字(任何) StringBuilder sb = new StringBuilder(); Random r = new Random(); int range = buffer.Length; ; i < iLength; i++) { sb.Append(buffer.Substring(r.Next(range),)); } return sb.ToS
from random import Random#随机生成4到20位的用户名def random_username(): username = '' chars = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789-_' length = len(chars) - 1 random = Random() for i in range(4,20): username +=chars[random.randint(0,
Function GenPasswd(length, level) Dim allstr, substr, passwd As String allstr = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()" Select Case level Case 1 strlen = 10 Case 2 strlen = 36 Case 3 strlen = 62 Case Else s