您现在的位置是:网站首页> 编程资料编程资料
asp 下产生任意位数随机密码的代码_应用技巧_
2023-05-25
182人已围观
简介 asp 下产生任意位数随机密码的代码_应用技巧_
<%
'******************************
'函数: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
%>
'******************************
'函数: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实现取得数组中的最大值的代码_应用技巧_
- asp下取得客户端IP地址函数 转换IP地址函数_应用技巧_
- asp下实现截取字符串特定部分内容函数_应用技巧_
- asp去除所有的超级链接的两种方法 替换与正则_应用技巧_
- asp快速开发方法之数据操作实例代码第1/3页_ASP基础_
- asp Chr 函数 数字转字母的方法_ASP基础_
- ReSaveRemoteFile函数之asp实现查找文件保存替换的代码_应用技巧_
- ReplaceSaveRemoteFile 替换、保存远程图片 的代码_应用技巧_
- DefiniteUrl asp将相对地址转换为绝对地址的代码_应用技巧_
