무작위로 사용자 비밀번호 (양호), 지침을 생성 : 비밀번호를 무작위로 생성 한 다음 등록 된 사용자에게 비밀번호를 이메일로 보내면 사용자의 이메일이 올바르게 채워 졌는지 확인할 수 있습니다.
참고 : 비밀번호를 무작위로 생성 한 다음 등록 된 사용자에게 비밀번호를 이메일로 보내면 사용자의 이메일이 올바르게 채워 졌는지 확인할 수 있습니다. 자동으로 생성 된 암호는 더 안전한 경향이 있으며 동시에 유효하지 않은 사용자를 필터링 할 수 있습니다.
다음 코드를 random.asp 파일로 저장하십시오.
코드 사본은 다음과 같습니다.
<%
기판 (strseed)
Dimi, Nseed
nseed = clng (0)
fori = 1tolen (strseed)
nseed = nseedxor ((256*((i-1) mod4))*ASCB (MID (strseed, i, 1))))
다음
randomizenseed
Endsub
functiongeneratepassword (nlength)
DIMI, BMADECONSONANT, C, NRND
conststrdoubleconsonants = "bdfglmnpst"
conststrConsonants = "bcdfghklmnpqrstv"
conststrvocal = "aeiou"
generatepassword = ""
bmadeconsonant = false
fori = 0tonlength
nrnd = rnd
ifgeneratepassword <> ""및 (bmadeconsonant <> true) 및 (nrnd <0.15)
c = mid (strdoubleconsonants, int (len (strdoubleconnants)*rnd+1), 1)
C = C & C
i = i+1
bmadeconsonant = true
또 다른
if (bmadeconsonant <> true) 및 (nrnd <0.95)
c = mid (strconsonants, int (len (strconsonants)*rnd+1), 1)
bmadeconsonant = true
또 다른
c = mid (strvocal, int (len (strvocal)*rnd+1), 1)
bmadeconsonant = false
endif
endif
GeneratePassword = GeneratePassword & c
다음
iflen (GeneratePassword)> nlengththen
GeneratePassword = left (GeneratePassword, nlength)