asp 下產(chǎn)生任意位數(shù)隨機(jī)密碼的代碼
更新時(shí)間:2007年08月08日 11:35:24 作者:
<%
'******************************
'函數(shù):MakePassword(byval maxlen)
'參數(shù):maxlen,要生成的密碼位數(shù)長(zhǎng)度
'作者:阿里西西
'日期:2007/7/12
'描述:產(chǎn)生任意位數(shù)隨機(jī)密碼
'示例:<%=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
%>
'******************************
'函數(shù):MakePassword(byval maxlen)
'參數(shù):maxlen,要生成的密碼位數(shù)長(zhǎng)度
'作者:阿里西西
'日期:2007/7/12
'描述:產(chǎn)生任意位數(shù)隨機(jī)密碼
'示例:<%=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
%>
相關(guān)文章
ASP把長(zhǎng)的數(shù)字用逗號(hào)隔開(kāi)顯示的代碼
對(duì)于一些比較長(zhǎng)的數(shù)字,我們可以用asp實(shí)現(xiàn)隔開(kāi)顯示,尤其是一些金錢(qián)相關(guān)的東西2008-06-06asp下實(shí)現(xiàn)批量插入數(shù)據(jù)的方法
asp下實(shí)現(xiàn)批量插入數(shù)據(jù)的方法...2007-08-08Microsoft VBScript 編譯器錯(cuò)誤 錯(cuò)誤原因 代碼大全
這篇文章主要介紹了Microsoft VBScript 編譯器錯(cuò)誤 錯(cuò)誤原因 代碼大全,需要的朋友可以參考下2015-07-07asp 實(shí)現(xiàn)當(dāng)有新信息時(shí)播放語(yǔ)音提示的效果
最近做一套程序的時(shí)候,客戶(hù)要求當(dāng)有新信息的時(shí)候播放一段語(yǔ)音來(lái)提示一下,根據(jù)情況,總結(jié)思路如下2009-06-06