asp 下产生任意位数随机密码的代码

所属分类: 网络编程 / ASP编程 阅读数: 1431
收藏 0 赞 0 分享
<%
'******************************
'函数:MakePassword(byval maxlen)
'参数:maxlen,要生成的密码位数长度
'作者:阿里西西
'日期:2007/7/12
'描述:产生任意位数随机密码
'示例:<%=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 
%>
更多精彩内容其他人还在看

ASP 指南

ASP 指南
收藏 0 赞 0 分享

改进 ASP 的字符串处理性能

改进 ASP 的字符串处理性能
收藏 0 赞 0 分享

pjblog2的参数第1/2页

pjblog2的参数
收藏 0 赞 0 分享

ASP智能搜索的实现

ASP智能搜索的实现
收藏 0 赞 0 分享

网站生成静态页面攻略2:数据采集

网站生成静态页面攻略2:数据采集
收藏 0 赞 0 分享

网站生成静态页面攻略3:防采集策略

网站生成静态页面攻略3:防采集策略
收藏 0 赞 0 分享

网站生成静态页面攻略4:防采集而不防搜索引擎策略

网站生成静态页面攻略4:防采集而不防搜索引擎策略
收藏 0 赞 0 分享

简单分页函数一 常用

简单分页函数一 常用
收藏 0 赞 0 分享

asp最常用的分页函数

asp最常用的分页函数
收藏 0 赞 0 分享

LINE9的目录浏览源程序

LINE9的目录浏览源程序
收藏 0 赞 0 分享
查看更多