'生成指定长度的纯字母的随机字符串 Dim num As Integer = Args(0) '传入要生成的随机码长度 Dim s As String = "" Dim zm As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" For i As Integer = 1 To num Dim rn As Integer = Rand.Next(0, 51) s += zm.Chars(rn) Next Return s
Dim s As String = Functions.Execute("RandLetter", 10) '例如10位长度 Output.Show(s)
效果: