加入收藏 | 设为首页 | 会员中心 | 我要投稿 汽车网 (https://www.0577qiche.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > Asp教程 > 正文

利用 asp 可生成的、支持多长度的随机数函数

发布时间:2023-09-07 11:38:30 所属栏目:Asp教程 来源:
导读:asp 生成任意英文+数字位数长度的随机码函数
<%
&#39;******************************
&#39;函数:Generator(Length)
&#39;参数:Length,任意长度的数值,随机码位数
&#39;作者:阿里西西
&#39;日期:2007/7/1
asp 生成任意英文+数字位数长度的随机码函数
<%
'******************************
'函数:Generator(Length)
'参数:Length,任意长度的数值,随机码位数
'作者:阿里西西
'日期:2007/7/15
'描述:生成任意英文+数字位数长度的随机码函数
'示例:Generator(80)
'******************************
Function Generator(Length)
 Dim i, tempS
 tempS = "abcdefghijklmnopqrstuvwxyz1234567890" 
 Generator = ""
 If isNumeric(Length) = False Then 
  Exit Function 
 End If 
 For i = 1 to Length 
  Randomize 
  Generator = Generator & Mid(tempS,Int((Len(tempS) * Rnd) + 1),1)
 Next 
End Function 
%>

(编辑:汽车网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章