Function makePass()'生成一个随机的字符串 Dim t,i i = 2 Dim s,pass s = "abcdefghijklmnopqistuvwsyzABCDEFGHIJKLMNOPQISTUVWSYZ1234567890" pass = "" For i = 1 To 7 Randomize '初始化随机数生成器。 t = Int(Rnd() * Len(s)) + 1 pass = pass + Mid(s,t,1) Next makePass = passEnd Function