-
-
'ฟังก์ชั่น: makepassword (byvalmaxlen)
'พารามิเตอร์: maxlen, ความยาวของตัวเลขรหัสผ่านที่จะสร้าง
'ผู้แต่ง: Alixi
'วันที่: 2007/7/12
'คำอธิบาย: สร้างรหัสผ่านแบบสุ่มของตัวเลขจำนวนใด ๆ
'ตัวอย่าง: <%= makepassword (8)%>
-
functionMakePassword (byvalmaxlen)
DimstrNewPass
dimwhatsnext, บน, ล่าง, intcounter
สุ่ม
forintCounter = 1tomaxlen
whatsnext = int ((1-0+1)*rnd+0)
ifwhatsnext = 0 แล้ว
'อักขระ
บน = 90
ต่ำกว่า = 65
อื่น
บน = 57
ต่ำกว่า = 48
endif
strNewPass = strNewPass & chr (int ((บนต่ำสุด+1)*rnd+ล่าง)))
ต่อไป
makepassword = strNewPass
endfunction
-