This article is a mirror article of machine translation, please click here to jump to the original article.

View: 15139|Reply: 0

[ASP.NET] Use Qaptcha as a captcha in ASP.NET

[Copy link]
Posted on 5/13/2015 9:59:49 AM | | |
First of all, sweat one, and someone changed the name of Qaptcha to Zipper Verification Code this time, speechless + speechless

Some people still asked how to tinker with this thing, and just in time for some time, they changed it and put it in the asp.net

I wrote about the configuration instructions of Qaptcha in php before, please click Portal. Let's start configuring the use of asp.net

1. Go to the official website to download the latest version, I downloaded 2.6, the current time is 2011-06-22,

2. Go to the jquery official website to download jquery1.6, which is also placed in the unzipped path

3. Write a static test page, a index.html, to see the effect


  1. <font color="#0000ff"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4.         <title>Pluggin QapTcha : captcha system with jQuery</title>
  5.         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6.         <link rel="stylesheet" href="jquery/QapTcha.jquery.css" type="text/css" />

  7.         <scrip去掉t type="text/javascrip去掉t" src="jquery/jquery-1.6.1.min.js"></scrip去掉t>
  8.         <scrip去掉t type="text/javascrip去掉t" src="jquery/jquery-ui.js"></scrip去掉t>
  9.         <scrip去掉t type="text/javascrip去掉t" src="jquery/jquery.ui.touch.js"></scrip去掉t>
  10.         <scrip去掉t type="text/javascrip去掉t" src="jquery/QapTcha.jquery.js"></scrip去掉t>
  11. </head>
  12. <body>
  13. <div id="main30corgDiv">
  14. <h1>QapTcha 2.5 样例</h1>

  15. <form method="post" action="http://blog.30c.org">
  16.         <fieldset>
  17.                 <label>帐号</label> <input type="text" name="userName" />
  18.                 <label>密码</label> <input type="text" name="userPwd" />
  19.                 <div id="QapTcha"></div>
  20.                 <input type="submit" name="submit" value="登录" />
  21.         </fieldset>
  22. </form>
  23. </div>
  24. <scrip去掉t type="text/javascrip去掉t">
  25.   $(document).ready(function(){
  26.                 $('#QapTcha').QapTcha({disabledSubmit:false});
  27.   });
  28. </scrip去掉t>
  29. </body>
  30. </html></font>
Copy code
4. Rewrite QapTcha.jquery.js
Find the location below

  1. <font color="#0000ff">// set the SESSION iQaptcha in PHP file
  2. $.post("wp-includes/qaptcha/php/Qaptcha.jquery.php",{
  3. action : 'qaptcha'
  4. },
  5. function(data) {
  6. if(!data.error)</font>
Copy code
Change
  1. <font color="#0000ff">$.post("server.aspx",{
  2. action : '30c.org'
  3. },
  4. function(data) {
  5. if(data=="1")</font>
Copy code
5. Write server.aspx


Open the server.aspx.cs and write the code below

  1. <font color="#0000ff">protected void Page_Load(object sender, EventArgs e)
  2.     {
  3.         Session["check"] = false;
  4.         if (Request.Form["action"] == "30c.org")
  5.         {
  6.             Session["check"] = true;
  7.             Response.Write("1");
  8.         }
  9.         else
  10.             Response.Write("0");
  11.         Response.End();
  12.     }</font>
Copy code
6. Get an IIS or development server to test it, go to bed and find that there are still some small bugs today, just corrected, and you can already run





Previous:asp.net Unable to start a project directly with "Class Library Output Type" To debug this project, please use this solution...
Next:Use Qaptcha as a verification code in the ASP.NET with the source code of the finished product
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com