01.
Function
RandomString(
ByVal
c
As
Integer
)
As
String
02.
Dim
RndStr
As
String
=
""
03.
Randomize()
04.
Dim
rgch
As
String
05.
rgch =
"abcdefghijklmnopqrstuvwxyz"
06.
rgch = rgch & UCase(rgch) &
"0123456789"
07.
08.
Dim
i
As
Long
09.
For
i = 1
To
c
10.
RndStr &= Mid$(rgch, Int(Rnd() * Len(rgch) + 1), 1)
11.
Next
12.
13.
Return
RndStr
14.
End
Function