Wednesday, August 29, 2012

Captcha in asp.net using c#.net

mscaptcha.xml:
<?xml version="1.0"?>
<doc>
    <assembly>
        <name>MSCaptcha</name>
    </assembly>
    <members>
        <member name="M:MSCaptcha.CaptchaControl.ValidateCaptcha(System.String)">
            <summary>
            Validate the user's text against the CAPTCHA text
            </summary>
        </member>
        <member name="M:MSCaptcha.CaptchaControl.HtmlColor(System.Drawing.Color)">
            <summary>
            returns HTML-ized color strings
            </summary>
        </member>
        <member name="M:MSCaptcha.CaptchaControl.CssStyle">
            <summary>
            returns css "style=" tag for this control
            based on standard control visual properties
            </summary>
        </member>
        <member name="M:MSCaptcha.CaptchaControl.Render(System.Web.UI.HtmlTextWriter)">
            <summary>
            render raw control HTML to the page
            </summary>
        </member>
        <member name="M:MSCaptcha.CaptchaControl.GenerateNewCaptcha">
            <summary>
            generate a new captcha and store it in the ASP.NET Cache by unique GUID
            </summary>
        </member>
        <member name="M:MSCaptcha.CaptchaControl.System#Web#UI#IPostBackDataHandler#LoadPostData(System.String,System.Collections.Specialized.NameValueCollection)">
            <summary>
            Retrieve the user's CAPTCHA input from the posted data
            </summary>
        </member>
        <member name="P:MSCaptcha.CaptchaControl.BackColor">
            <summary>
            Background color for the captcha image
            </summary>
        </member>
        <member name="P:MSCaptcha.CaptchaControl.FontColor">
            <summary>
            Color of captcha text
            </summary>
        </member>
        <member name="P:MSCaptcha.CaptchaControl.NoiseColor">
            <summary>
            Color for dots in the background noise
            </summary>
        </member>
        <member name="P:MSCaptcha.CaptchaControl.LineColor">
            <summary>
            Color for the background lines of the captcha image
            </summary>
        </member>
        <member name="P:MSCaptcha.CaptchaControl.IsDesignMode">
            <summary>
            are we in design mode?
            </summary>
        </member>
        <member name="M:MSCaptcha.CaptchaImage.RenderImage">
            <summary>
            Forces a new Captcha image to be generated using current property value settings.
            </summary>
        </member>
        <member name="M:MSCaptcha.CaptchaImage.RandomFontFamily">
            <summary>
            Returns a random font family from the font whitelist
            </summary>
        </member>
        <member name="M:MSCaptcha.CaptchaImage.GenerateRandomText">
            <summary>
            generate random text for the CAPTCHA
            </summary>
        </member>
        <member name="M:MSCaptcha.CaptchaImage.RandomPoint(System.Int32,System.Int32,System.Int32,System.Int32)">
            <summary>
            Returns a random point within the specified x and y ranges
            </summary>
        </member>
        <member name="M:MSCaptcha.CaptchaImage.RandomPoint(System.Drawing.Rectangle)">
            <summary>
            Returns a random point within the specified rectangle
            </summary>
        </member>
        <member name="M:MSCaptcha.CaptchaImage.TextPath(System.String,System.Drawing.Font,System.Drawing.Rectangle)">
            <summary>
            Returns a GraphicsPath containing the specified string and font
            </summary>
        </member>
        <member name="M:MSCaptcha.CaptchaImage.GetFont">
            <summary>
            Returns the CAPTCHA font in an appropriate size
            </summary>
        </member>
        <member name="M:MSCaptcha.CaptchaImage.GenerateImagePrivate">
            <summary>
            Renders the CAPTCHA image
            </summary>
        </member>
        <member name="M:MSCaptcha.CaptchaImage.WarpText(System.Drawing.Drawing2D.GraphicsPath,System.Drawing.Rectangle)">
            <summary>
            Warp the provided text GraphicsPath by a variable amount
            </summary>
        </member>
        <member name="M:MSCaptcha.CaptchaImage.AddNoise(System.Drawing.Graphics,System.Drawing.Rectangle)">
            <summary>
            Add a variable level of graphic noise to the image
            </summary>
        </member>
        <member name="M:MSCaptcha.CaptchaImage.AddLine(System.Drawing.Graphics,System.Drawing.Rectangle)">
            <summary>
            Add variable level of curved lines to the image
            </summary>
        </member>
        <member name="P:MSCaptcha.CaptchaImage.UniqueId">
            <summary>
            Returns a GUID that uniquely identifies this Captcha
            </summary>
        </member>
        <member name="P:MSCaptcha.CaptchaImage.RenderedAt">
            <summary>
            Returns the date and time this image was last rendered
            </summary>
        </member>
        <member name="P:MSCaptcha.CaptchaImage.Font">
            <summary>
            Font family to use when drawing the Captcha text. If no font is provided, a random font will be chosen from the font whitelist for each character.
            </summary>
        </member>
        <member name="P:MSCaptcha.CaptchaImage.FontWarp">
            <summary>
            Amount of random warping to apply to the Captcha text.
            </summary>
        </member>
        <member name="P:MSCaptcha.CaptchaImage.BackgroundNoise">
            <summary>
            Amount of background noise to apply to the Captcha image.
            </summary>
        </member>
        <member name="P:MSCaptcha.CaptchaImage.TextChars">
            <summary>
            A string of valid characters to use in the Captcha text.
            A random character will be selected from this string for each character.
            </summary>
        </member>
        <member name="P:MSCaptcha.CaptchaImage.TextLength">
            <summary>
            Number of characters to use in the Captcha text.
            </summary>
        </member>
        <member name="P:MSCaptcha.CaptchaImage.Text">
            <summary>
            Returns the randomly generated Captcha text.
            </summary>
        </member>
        <member name="P:MSCaptcha.CaptchaImage.Width">
            <summary>
            Width of Captcha image to generate, in pixels
            </summary>
        </member>
        <member name="P:MSCaptcha.CaptchaImage.Height">
            <summary>
            Height of Captcha image to generate, in pixels
            </summary>
        </member>
        <member name="P:MSCaptcha.CaptchaImage.FontWhitelist">
            <summary>
            A semicolon-delimited list of valid fonts to use when no font is provided.
            </summary>
        </member>
        <member name="P:MSCaptcha.CaptchaImage.BackColor">
            <summary>
            Background color for the captcha image
            </summary>
        </member>
        <member name="P:MSCaptcha.CaptchaImage.FontColor">
            <summary>
            Color of captcha text
            </summary>
        </member>
        <member name="P:MSCaptcha.CaptchaImage.NoiseColor">
            <summary>
            Color for dots in the background noise
            </summary>
        </member>
        <member name="P:MSCaptcha.CaptchaImage.LineColor">
            <summary>
            Color for the background lines of the captcha image
            </summary>
        </member>
        <member name="T:MSCaptcha.CaptchaImage.FontWarpFactor">
            <summary>
            Amount of random font warping to apply to rendered text
            </summary>
        </member>
        <member name="T:MSCaptcha.CaptchaImage.BackgroundNoiseLevel">
            <summary>
            Amount of background noise to add to rendered image
            </summary>
        </member>
        <member name="T:MSCaptcha.CaptchaImage.LineNoiseLevel">
            <summary>
            Amount of curved line noise to add to rendered image
            </summary>
        </member>
    </members>
</doc>

web.config:

<system.web>
   <httpHandlers>
      <add verb="GET" path="CaptchaImage.axd" type="MSCaptcha.CaptchaImageHandler, MSCaptcha"/>
    </httpHandlers>
</system.web>


Adding Captcha dll :


  <cc1:CaptchaControl ID="Captcha1" runat="server" CaptchaBackgroundNoise="Low" CaptchaLength="5"
                                                        CaptchaHeight="60" CaptchaWidth="160" CaptchaLineNoise="None" CaptchaMinTimeout="5"
                                                        CaptchaMaxTimeout="240" FontColor="#529E00" BackColor="Silver" />

4 comments:

  1. I found your blog while searching for the updates, I am happy to be here. Very useful content and also easily understandable providing..
    Believe me I did wrote an post about tutorials for beginners with reference of your blog. 




    Selenium training in bangalore
    Selenium training in Chennai
    Selenium training in Bangalore
    Selenium training in Pune
    Selenium Online training

    ReplyDelete