脚本如下:
Sub main ()
Dim i As Integer
Dim strL As String
i = 10
strL = StrRan(i)
Stop
End Sub
Function StrRan(ByVal maxLen) As String
Dim strNewPass As String
Dim whatsNext As Integer
Dim upper As Integer
Dim lower As Integer
Dim intCounter As Integer
Randomize
For intCounter = 1 To maxLen
whatsNext = Int((1 - 0 + 1) * Rnd + 0)
If whatsNext = 0 Then
upper = 90
lower = 65
Else
upper = 57
lower = 48
End If
strNewPass = strNewPass & Chr(Int((upper - lower + 1) * Rnd + lower))
Next
‘最后一位我加了一,生成的数据是总数位数
StrRan = strNewPass + CStr(maxLen + 1)
End Function作者: pcl2004_27 时间: 2004-11-6 21:43
剩下的是研究数据池到底是什么了,数据池是按照一定顺序排列的文本文件(txt),你可以看我写的datapool的介绍和使用,里边有数据池的介绍