asp 下产生任意位数随机密码的代码_ASP教程-查字典教程网
asp 下产生任意位数随机密码的代码
asp 下产生任意位数随机密码的代码
发布时间:2016-12-29 来源:查字典编辑
摘要:

<%

'******************************

'函数:MakePassword(byvalmaxlen)

'参数:maxlen,要生成的密码位数长度

'作者:阿里西西

'日期:2007/7/12

'描述:产生任意位数随机密码

'示例:<%=MakePassword(8)%>

'******************************

functionMakePassword(byvalmaxlen)

dimstrnewpass

dimwhatsnext,upper,lower,intcounter

randomize

forintcounter=1tomaxlen

whatsnext=int((1-0+1)*rnd+0)

ifwhatsnext=0then

'character

upper=90

lower=65

else

upper=57

lower=48

endif

strnewpass=strnewpass&chr(int((upper-lower+1)*rnd+lower))

next

makepassword=strnewpass

endfunction

%>

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新ASP教程学习
    热门ASP教程学习
    编程开发子分类