<%
Function printPassword()
'Declare some variables
Dim password, chars, i, arr, rand, startchars, u, arrstart, randst, endchars, endarr, d, randend, pwdstart, pwdend
'Setup an charlibrary to use when password is beeing generarted
startchars = "a b c d e f g h i j k l m n o p q r s t u v w x y z"
endchars = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"
chars = "A a B b C c D d E e f G g H h I i J j k L l m N n O o P p q r S s T t U u V v w Y y Z z 0 1 2 3 4 5 6 7 8 9 ! @ £ # % / * - + ?"
'Creates an array with all letters from the library
arrstart = Split(startchars," ")
arr = Split(chars," ")
endarr = Split(endchars," ")
'Start to generate a randomized password
For u = 1 To 2
Randomize
randst = int(rnd*25)+1
pwdstart = pwdstart & arrstart(randst)
Next
For i = 1 To 10
Randomize
rand = int(rnd*63)+1
password = password & arr(rand)
Next
For d = 1 To 2
Randomize
randend = int(rnd*25)+1
pwdend = pwdend & endarr(randend)
Next
'Merge all generated parts of the password, printPassword = (pwdstart)(password)(pwdend)
printPassword = pwdstart + password + pwdend
End Function
'Prints out the new generated password
Response.Write printPassword()
%>