怎么让VB自动生成一串字母(数字+字母)
来源:百度知道 编辑:UC知道 时间:2024/05/07 06:50:02
怎么让VB自动生成一串字母(数字+字母)
dim a as byte
do
a = int(150 * rnd)
if a =< asc("9") and a >= asc("0") then
temp = temp & chr(a)
i = i +1
endif
if a =< asc("z") and a => asc("a") then
temp = temp & chr(a)
i = i +1
endif
if a =< asc("Z") and a => asc("A") then
temp = temp & chr(a)
i = i +1
endif
if i >n then exit do 'n 是你要的字符串的数量
loop
循环产生随机数 ...
然后往产生的结果上添加 CHR(随机数) 的值 ...
循环