|
EL PASSWORD SERA REENVIADO AUTOMATICAMENTE A LA DIRECCIÓN DE CORREO ELECTRÓNICO QUE USASTES PARA DAR EL ALTA DE USUARIO
Inserta el siguiente codigo visual para reenviarle su contraseña.
66 Then m_arrCaptchaScreen(i) = "" & Hex(Asc(strtoupper(sTmp))) & ";" '// Hexify
If iTmp < 67 And iTmp > 32 Then m_arrCaptchaScreen(i) = strtoupper(sTmp) '// Plain Ascii
Next
'---------------------------- What question will we ask the human visitor?
m_lngQuestionIndex = 4
'---------------------------- Create CSS and javascript
Call CreateStyleSheet
Call CreateJavascript
'---------------------------- Check to see if someone submitted CAPTCHA, machine or human
'// You may want to move this code to another part of your own application and do the testing there.
If Len(request.form(NAME_OF_CAPTCHA_TEXTBOX)) > 0 Then
If strtoupper(request.form(NAME_OF_CAPTCHA_TEXTBOX)) = strtoupper(Session("CAPTCHA")) Then
m_sUserResult = "You typed " & request.form(NAME_OF_CAPTCHA_TEXTBOX) & " which was correct!"
Else
m_sUserResult = "You typed " & request.form(NAME_OF_CAPTCHA_TEXTBOX) & " which was wrong!" & _
" (Support for cookies must be enabled in your web browser.)"
End If
End If
'// Nothing was submitted, so just set a new session value which is our CAPTCHA characters or a color
Session("CAPTCHA") = Replace(Join(m_arrCaptcha), " ", "")
'response.write "session catcha es.." & Session("CAPTCHA")
'// We will ask visitor for a color! Reduce m_lngQuestionIndex by 1 to match the m_arrCaptchaColor array
If (m_lngQuestionIndex > 0) Then Session("CAPTCHA") = m_arrCaptchaColor(m_lngQuestionIndex - 1)
'---------------------------- Return the html
CreateCAPTCHA = m_sCSS & m_sJavascript
End Function
'------------------------------------------------------------------------------------------------------------
' Comment: Randomize our module arrays holding the CSS values.
'------------------------------------------------------------------------------------------------------------
Sub InitArrays()
On Error Resume Next
'// First 4 arrays are randomly sorted meaning that all characters might have the same color.
Call RandomizeArray(m_arrColor, m_arrColorNew)
Call RandomizeArray(m_arrFontFamily, m_arrFontFamilyNew)
Call RandomizeArray(m_arrFontSize, m_arrFontSizeNew)
Call RandomizeArray(m_arrTopPosition, m_arrTopPositionNew)
Call RandomizeArrayUnique(m_arrCSSStrings, m_arrCSSStringsNew)
End Sub
'------------------------------------------------------------------------------------------------------------
' Comment: Build the CSS.
'------------------------------------------------------------------------------------------------------------
Sub CreateStyleSheet()
On Error Resume Next
Dim sCSS, i, l, iLeft, sTmp, sTmpClassName
'---------------------------- Create the CSS for the div box
'// First create a random name for the wrapper div.
m_sNameOfWrapperDiv = RandomString(MAX_LENGTH_CSS_CLASSES)
sCSS = ""
End Sub
'------------------------------------------------------------------------------------------------------------
' Comment: Create the javascript with our unique css class names and the CAPTCHA characters.
'------------------------------------------------------------------------------------------------------------
Sub CreateJavascript()
On Error Resume Next
Dim i, sJScript
sJScript = "" & vbCrLf
sJScript = sJScript & " " & m_arrQuestions(m_lngQuestionIndex) & " " & vbCrLf
m_sJavascript = sJScript
End Sub
'------------------------------------------------------------------------------------------------------------
' Comment: Randomize array but make sure all values are present in the new array.
'------------------------------------------------------------------------------------------------------------
Function RandomizeArrayUnique(arr, arrNew)
On Error Resume Next
Dim i, l, sBuf, sTmp, iMax
iMax = UBound(arr)
ReDim arrNew(iMax)
For i = 0 To iMax
'// This should be enough looping
For l = 1 To (iMax * 20)
sTmp = arr(RandomNumber(iMax + 1))
If InStr(sBuf, sTmp) = 0 Then
sBuf = (sBuf & sTmp)
arrNew(i) = sTmp
Exit For
End If
Next
Next
End Function
'------------------------------------------------------------------------------------------------------------
' Comment: Randomize our module arrays holding the CSS. One value might appear several times.
'------------------------------------------------------------------------------------------------------------
Function RandomizeArray(arr, arrNew)
On Error Resume Next
Dim i
ReDim arrNew(UBound(arr))
For i = LBound(arr) To UBound(arr)
arrNew(i) = arr(RandomNumber(UBound(arr) + 1))
Next
End Function
'------------------------------------------------------------------------------------------------------------
' Comment: Return a random number not bigger than the input parameter.
'------------------------------------------------------------------------------------------------------------
Function RandomNumber(iMax)
On Error Resume Next
Randomize
RandomNumber = Int(iMax * Rnd)
End Function
'------------------------------------------------------------------------------------------------------------
' Comment: Create a random string of lower case letters [a-z] for the css class names.
'------------------------------------------------------------------------------------------------------------
Function RandomString(iMax)
On Error Resume Next
Dim i, sTmp
For i = 1 To iMax
sTmp = sTmp & Chr(97 + RandomNumber(26)) '// Return a random number between 97 and 122, ascii values for [a-z]
Next
RandomString = sTmp
End Function
'============================================================ END OF ASP CODE
?>
|
|