Captcha : Formularios + Validar + Imagen Aleatorio en VB.NET

5 Febrero, 2009 por admin Dejar una respuesta »

Si lo que queréis es validar formularios para VB.NET con las imágenes de las letras aleatorios  “CaptCha”. Aquí tenéis una librería gratuita solo tenéis que seguir unos pasos muy fáciles para insertarla en vuestros código fuente de VB.NET

En el Fichero aspx
<%@ Register Assembly=”MSCaptcha” Namespace=”MSCaptcha” TagPrefix=”cc1″ %>

 <label for=”label1″>Código de validación:</label>
<cc1:CaptchaControl ID=”ccJoin” runat=”server” CaptchaBackgroundNoise=”low”                         CaptchaLength=”6″ CaptchaHeight=”40″ CaptchaWidth=”200″ CaptchaLineNoise=”none” CaptchaMinTimeout=”5″    CaptchaMaxTimeout=”240″/>
<asp:TextBox ID=”tbCap” runat=”server”></asp:TextBox>
<asp:Button ID=”bEnviar” runat=”server” Text=”Enviar” Width=”70px” />

 

 En el Fichoro aspx.vb

ccJoin.ValidateCaptcha(tbCap.Text)
       If Not ccJoin.UserValidated Then

            LblMensaje.Text = “El código ingresado no es valido. Reintente.”

            tbCap.Text = “”

            Exit Sub

        End If

 En el Fichero Web.Congif

 

Añadir dentro de la seccion <httphandlers>

 

<add verb=GET path=CaptchaImage.axd type=MSCaptcha.CaptchaImageHandler, MSCaptcha/>

 

Publicidad

Dejar un comentario

*