ASP随机产生字母怎么老是重复呢?各位帮帮忙民!源码放上!
下面源码,我制作卡到一定数量就会重复,比如我一次制20张卡,卡1,卡2,卡3,卡4,卡5,卡6,卡7,卡8,卡9,卡10...卡20,通常从卡9开始就重复卡1到卡8了,真不知是什么问题啊~~求各位帮帮忙了!!!<%
dim shijian,shumu,kami,zaokaren
shijian=request("item")
shumu=request("shumu")
zaokaren=request("u")
rs.open "select * from kaka ",con,1,3
for i = 1 to shumu step 1
kaka=suijimima(32)
rs.addnew
rs("card")=kaka
rs("type")=shijian
rs("status")="未使用"
rs("make")=zaokaren
rs.update
next
rs.close
set rs=nothing
response.write("制作充值卡成功")
response.end
Function suijimima(ByVal mimaweishu)
Dim suijishu,i,ZM,k
ZM = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
k = Len(ZM)
For i = 1 To mimaweishu
Randomize
j=Int(k * Rnd )+1
suijimima = suijimima & Mid(ZM,j,1)
Next
End Function
%>
[ 本帖最后由 kainet 于 2011-11-2 15:53 编辑 ]