如何編制一個(gè)產(chǎn)生隨機(jī)密碼的函數(shù)?
更新時(shí)間:2006年11月16日 00:00:00 作者:
<%
response.write makePassword(16)
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
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
%>
response.write makePassword(16)
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
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
%>
[1]
相關(guān)文章
如何在ASP中恰當(dāng)?shù)剡\(yùn)用Cookies?
如何在ASP中恰當(dāng)?shù)剡\(yùn)用Cookies?...2006-11-11如何實(shí)現(xiàn)無(wú)組件上傳二進(jìn)制文件?
如何實(shí)現(xiàn)無(wú)組件上傳二進(jìn)制文件?...2006-11-11問(wèn)題解析:為什么數(shù)組下標(biāo)從0?開(kāi)始而不是?1??
這篇文章主要為大家介紹了為什么數(shù)組下標(biāo)是從0?開(kāi)始而不是?1?呢的問(wèn)題解析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-04-04如何用下拉列表顯示數(shù)據(jù)庫(kù)里的內(nèi)容?
如何用下拉列表顯示數(shù)據(jù)庫(kù)里的內(nèi)容?...2006-11-11如何在讀取Excel文件時(shí)創(chuàng)建列表的下拉菜單?
如何在讀取Excel文件時(shí)創(chuàng)建列表的下拉菜單?...2006-11-11