Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    Verificare password casuale

    Salve a tutti.
    Ho un problemino con un generatore di password o meglio il generatore funziona bene e il passo successivo che mi blocca. Ho il seguente script:

    <%
    Sub StrRandomize(strSeed)
    Dim i, nSeed

    nSeed = CLng(0)
    For i = 1 To Len(strSeed)
    nSeed = nSeed Xor ((256 * ((i - 1) Mod 4) * AscB(Mid(strSeed, i, 1))))
    Next

    Randomize nSeed
    End Sub

    Function GeneratePassword(nLength)
    Dim i, bMadeConsonant, c, nRnd

    Const strDoubleConsonants = "bdfglmnpst"
    Const strConsonants = "bcdfghklmnpqrstv"
    Const strVocal = "aeiou"

    GeneratePassword = ""
    bMadeConsonant = False

    For i = 0 To nLength

    nRnd = Rnd

    If GeneratePassword <> "" AND _
    (bMadeConsonant <> True) AND (nRnd < 0.15) Then

    c = Mid(strDoubleConsonants, Len(strDoubleConsonants) * Rnd + 1, 1)
    c = c & c
    i = i + 1
    bMadeConsonant = True
    Else

    If (bMadeConsonant <> True) And (nRnd < 0.95) Then

    c = Mid(strConsonants, Len(strConsonants) * Rnd + 1, 1)
    bMadeConsonant = True

    Else

    c = Mid(strVocal, Len(strVocal) * Rnd + 1, 1)
    bMadeConsonant = False
    End If
    End If

    GeneratePassword = GeneratePassword & c
    Next

    If Len(GeneratePassword > nLength) Then
    GeneratePassword = Left(GeneratePassword, nLength)
    End If
    End Function
    %>

    Che genera una password casuale; ora vorrei sapere come fare ad inserire un controllo (attraverso un form) che verifichi la password.

    Premesso che la password è stata visualizzata:
    <%StrRandomize CStr(Now) & CStr(Rnd) response.write GeneratePassword(6)%>

    Diciamo che vorrei avere il risultato che si otterrebbe usando un CAPTCHA

    Grazie e Saluti
    "Un vincente trova sempre una strada. Un Perdente trova sempre una scusa"

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Che vuol dire verificare una password casuale???

    Roby

  3. #3

    Re: Verificare password casuale

    Originariamente inviato da ZiGGyMaster
    Diciamo che vorrei avere il risultato che si otterrebbe usando un CAPTCHA
    E perchè allora non usi un CAPTCHA?

  4. #4
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    La devi passare in session.

    Roby

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.