generate random string(产生随机数)

1
2
3
4
5
6
7
8
9
10
Function RandomString( ByVal strLen )     
    Dim str     
    Const LETTERS = "abcdefghijklmnopqrstuvwxyz0123456789"

    For i = 1to strLen      
        str = str & Mid( LETTERS, RandomNumber( 1, Len( LETTERS ) ), 1 )     
    Next     

    RandomString = str 
EndFunction