25. maj 2001 - 00:32
Der er
4 kommentarer og
1 løsning
Password maker
Jeg har denne password maker:
Function MakePassword(intAntaltegn)
For x = 1 To intAntalTegn
Randomize
intChooser = Int(Rnd * 2) + 1
Select Case intChooser
Case 1
intWildChar = Int(Rnd * 57) + 65
If intWildChar => 91 And intWildChar <= 96 Then
intWildChar = intWildChar + 8
End If
strPassword = strPassword & Chr(intWildChar)
Case Else
intWildChar = Int(Rnd * 9) + 1
strPassword = strPassword & intWildChar
End Select
Next
MakePassword = strPassword
End Function
Hvordan får jeg den til at sortere 1 I O 0 fra??
Du kunne f.eks. gøre følgende:
Function MakePassword(intAntaltegn)
\' Lav et array der indeholder de bogstaver, du vil bruge
arrAlfa = Array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\")
\' Lav et array der indeholder de tal, du vil bruge
arrNum = Array(2, 3, 4, 5, 6, 7, 8, 9)
For x = 1 To intAntalTegn
Randomize
intChooser = Int(Rnd * 2) + 1
Select Case intChooser
Case 1
\' Tilføj et bogstav
intWildChar = Int(Rnd * (UBound(arrAlfa) + 1))
strPassword = strPassword & arrAlfa(intWildChar)
Case 2
\' Tilføj et tal
intWildChar = Int(Rnd * (UBound(arrNum) + 1))
strPassword = strPassword & arrNum(intWildChar)
End Select
Next
MakePassword = strPassword
End Function