'Loop through and create the output based on the the variable passed to
'the function for the length of the key.
do while len(output) < digits
num = char_array(Int((35 - 0 + 1) * Rnd + 0))
output = output + num
loop
'Set return
gen_key = output
End Function
'Write the results to the browser, currently setting a 13 digit key
response.write "<pre>" & gen_key(14) & "</pre>" & vbcrlf
response.write "<pre>" & gen_key(14) & "</pre>" & vbcrlf
response.write "<pre>" & gen_key(14) & "</pre>" & vbcrlf
response.write "<pre>" & gen_key(14) & "</pre>" & vbcrlf
%>
怎样想产生几组就产生几组啊?
这个例子不是很清楚吗?
function gen_key(digits)
里的digits表示循环的次数,想产生几组只要加个循环就可以了。
比如说
for i=1 to n 'n表示你想产生的组数
response.write "<pre>"&gen_key(digits)&"</pre>"&vbcrlf 'digits根据每组数的位数进行调整
next
不行啊,我加了,代码如下
n=request("n") 'n通过一个表单传过来
if n="" then
n=1
end if
for i=1 to n
do while i = n
next
response.write "<pre>" & gen_key(14) & "</pre>" & vbcrlf
显示缺少语句End function,不知怎么办?〉