Image verification code, which can be numbers, English characters, and Chinese characters. Source Code download is provided.

Source: Internet
Author: User
The function is to generate an image and save the text in the image to the session. The source code is downloaded.

Create An ASPX file to provide the verification code image. For example, validcode. aspx, add this event to pageload.
 

C # Code
    1. Protected VoidPage_load (ObjectSender, eventargs E)
    2. {
    3. Session ["Validcode"] = Socansoft. validcode. createimage (4, socansoft. validcode. validtype. Numeric );
    4. }

This page is the page that provides the image source. to test it, the front-end html
 

XML/html code
  1. <ASP: Image ID="Image1" Runat="Server" Imageurl="/Webbbs/validcode. aspx" />
  2. <ASP: textbox ID="Textbox1" Runat="Server"></ASP: textbox>
  3. <ASP: button ID="Button1" Runat="Server" Onclick="Button#click" Text="Button" /></Div>

Background code
 

C # code
    1. Protected void button#click (Object sender, eventargs E)
    2. {

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.