Frågan#1
Lösenordsslumpare 1
Slumpar efter bestämd ordning av stora-, småbokstäver och siffror
<%
Randomize Timer
For i = 1 to 6
if t < 5 then
'Stor bokstav
s = s & Chr(Int(Rnd * 25) + 65)
elseif 5<t and t < 10 then
'Siffra
s = s & (Int(Rnd * 25) Mod 10)
else
'liten bokstav
s = s & LCASE(Chr(Int(Rnd * 25) + 65))
end if
t = (Int(Rnd * 50) Mod 15)
Next
password = s
%>
Lösenordsslumpare 2
Slumpar helt mellan angivna teken nedan.
<%
Function getRandomPassword(ByVal iNoChars)
Dim sChars, sPassword
Dim i
Randomize(Timer())
'Vilka bokstäver skall användas?
sChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
For i = 1 to iNoChars
sPassword = sPassword & Mid(sChars, Rnd * Len(sChars) + 1, 1)
Next
getRandomPassword = sPassword
End Function
'Hur många tecken skall skriva ut (för tillfället 6 st).
password = getRandomPassword(6)
%>
------------------
fencing for you?
http://www.fencing4u.nu/