asp 生成任意英文+数字位数长度的随机码函数
2018-09-06 12:26
阅读:656
            
  <% 
****************************** 
函数:Generator(Length) 
参数:Length,任意长度的数值,随机码位数 
作者:阿里西西 
日期:2007/7/15 
描述:生成任意英文+数字位数长度的随机码函数 
示例:Generator(80) 
****************************** 
FunctionGenerator(Length) 
Dimi,tempS 
tempS=abcdefghijklmnopqrstuvwxyz1234567890 
Generator= 
IfisNumeric(Length)=FalseThen 
ExitFunction 
EndIf 
Fori=1toLength 
Randomize 
Generator=Generator&Mid(tempS,Int((Len(tempS)*Rnd)+1),1) 
Next 
EndFunction 
%>
评论
亲,登录后才可以留言!