加入收藏 | 设为首页 | 会员中心 | 我要投稿 聊城站长网 (https://www.0635zz.com/)- 智能语音交互、行业智能、AI应用、云计算、5G!
当前位置: 首页 > 站长学院 > Asp教程 > 正文

asp 下形成任意位数随机密码的代码

发布时间:2023-09-18 14:59:55 所属栏目:Asp教程 来源:
导读:&#39;示例:<%=MakePassword(8)%>

&#39;******************************

function MakePassword(byval maxlen)

dim strnewpass

dim whatsnext, upper, lower, intcounter

randomize

for int
'示例:<%=MakePassword(8)%>
 
'******************************
 
function MakePassword(byval maxlen)
 
dim strnewpass
 
dim whatsnext, upper, lower, intcounter
 
randomize
 
for intcounter = 1 to maxlen
 
whatsnext = int((1 - 0 + 1) * rnd + 0)
 
if whatsnext = 0 then
 
'character
 
upper = 90
 
lower = 65
 
else
 
upper = 57
 
lower = 48
 
end if
 
strnewpass = strnewpass & chr(int((upper - lower + 1) * rnd + lower))
 
next
 
makepassword = strnewpass
 
end function
 
%>
 
 

(编辑:聊城站长网)

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

    推荐文章