编写一个刷投票外挂的代码容易吗?

投票教程 admin 0浏览

编写一个刷投票外挂的代码容易吗?

今天写一篇关于编写刷投票外的代码,因为近期有很多的网友们都在问这样的问题,毕竟现在的投票活动实在是火爆的不得了,你但凡想要取得冠军或者是理想的名次,几乎都是需要借助刷票的力量来帮助自己才有可能实现的,那么下面我来给大家说下刷投票外挂的代码吧

刷投票外挂截图:

编写一个刷投票外挂的代码容易吗?

一、生成验证码图片并显示代码

由于C#代码难度不大,这里就不再细讲了,仅贴出代码,最后给出源码,大家可以参考;

  1. private void button1_Click(object sender, EventArgs e)
  2. {
  3. System.Net.ServicePointManager.Expect100Continue = false;
  4. Uri uri = new Uri(“http://edu.sqzycc.com/inc/checkcode.asp”);
  5. HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri);
  6. HttpWebResponse response = (HttpWebResponse)request.GetResponse();
  7. Stream resStream = response.GetResponseStream();//得到验证码数据流
  8. Bitmap sourcebm = new Bitmap(resStream);//初始化Bitmap图片
  9. //sourcebm.Save(@”C:\test.gif”, ImageFormat.Gif);//可以保存到本地
  10. this.pictureBox1.Image = sourcebm;
  11. }

二、向服务器处理程序POST数据

  1. private void button2_Click(object sender, EventArgs e)
  2. {
  3. System.Net.ServicePointManager.Expect100Continue = false;
  4. //string strsubmit = “YES”;
  5. ASCIIEncoding encoding = new ASCIIEncoding();
  6. string data2 = this.textBox1.Text;
  7. string postData = “pr_id=1&hxr=26&hxr=30&hxr=33&hxr=39&hxr=53&hxr=54&hxr=66&hxr=69&hxr=70&hxr=81&code=” + data2 + “&cid=411402198807885982&x=9&y=5”;
  8. this.label1.Text = postData;
  9. byte[] data = encoding.GetBytes(postData);
  10. // Prepare web request…
  11. HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(“http://edu.sqzycc.com/do.asp?action=post”);
  12. myRequest.Method = “POST”;
  13. myRequest.ContentType = “application/x-www-form-urlencoded”;
  14. myRequest.UserAgent = “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)”;
  15. myRequest.ContentLength = data.Length;
  16. Stream newStream = null;
  17. try
  18. {
  19. newStream = myRequest.GetRequestStream();
  20. }
  21. catch (Exception ex)
  22. {
  23. this.label2.Text = ex.Message;
  24. return;
  25. }
  26. // Send the data.
  27. newStream.Write(data, 0, data.Length);
  28. newStream.Close();
  29. // Get response
  30. HttpWebResponse httpWebResponse = null;
  31. try
  32. {
  33. httpWebResponse = (HttpWebResponse)myRequest.GetResponse();
  34. }
  35. catch (Exception ex)
  36. {
  37. this.label2.Text = ex.Message;
  38. return;
  39. }
  40. Stream responseStream = httpWebResponse.GetResponseStream();
  41. //这段用来获取返回信息的编码方式,以防乱码
  42. Encoding MyEncoding = Encoding.Default;
  43. // 如果要下载的页面经过压缩,则先解压
  44. if (httpWebResponse.ContentEncoding.ToLower().IndexOf(“gzip”) >= 0)
  45. {
  46. responseStream = new GZipStream(responseStream, CompressionMode.Decompress);
  47. }
  48. if (MyEncoding == null)
  49. {
  50. MyEncoding = Encoding.Default;
  51. }
  52. StreamReader reader = new StreamReader(responseStream, MyEncoding);
  53. string content = reader.ReadToEnd();
  54. this.label2.Text = content;
  55. }

写于最后,至于如何得知后台处理程序的地址的,可以在IE中使用HttpWatch抓包实现,也可以在chrome中使用“开发者工具”下的Network标签

当选中“preserve log”时,该程序就会持序记录网络行为。(源码在最后)

三、关于验证码自动识别

关于验证码自动识别的问题,昨天我稍微研究了一下,主要用到Tesseract-OCR,这个东东就可以做到图片自动识别,但我试了下,一般而言,识别率不太高;如果针对特定网站做验证识别的话,可能要对Tesseract进行数据训练,以提高准确率。

版权申明:本篇文章属于原创,转载请注明出自微信投票网。原文地址: https://www.aivote.com/12981.html