FrmFramVerify.cs
上传用户:xhd1221
上传日期:2022-05-28
资源大小:186k
文件大小:3k
源码类别:

外挂编程

开发平台:

C/C++

  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using System.IO;
  9. using System.Threading;
  10. namespace QQWinFarm
  11. {
  12.     public partial class FrmFramVerify : Form
  13.     {
  14.         private System.Net.CookieContainer cookie = new System.Net.CookieContainer();
  15.         string _uid = "";
  16.         public FrmFramVerify(System.Net.CookieContainer _cookieContainer,string uid)
  17.         {
  18.             cookie = _cookieContainer;
  19.             _uid = uid;
  20.             InitializeComponent();
  21.         }
  22.         public FrmFramVerify()
  23.         {
  24.             InitializeComponent();
  25.         }
  26.         
  27.         #region 获得验证码
  28.         /// <summary> 
  29.         /// 获得验证码 
  30.         /// </summary> 
  31.         private void GgetVerifyImage()
  32.         {
  33.             Stream s = HttpHelper.GetStream("http://ptlogin2.qq.com/getimage?aid=353&0.49157994566485286", cookie);
  34.             if (s == null)
  35.             {
  36.                 MessageBox.Show("外挂获取登陆码错误,请检查您的网络!", "提示信息");
  37.                 Application.ExitThread();
  38.                 return;
  39.             }
  40.             picVerify.Image = Image.FromStream(s);
  41.             s.Close();
  42.         }
  43.         #endregion
  44.         private void FrmFramVerify_Load(object sender, EventArgs e)
  45.         {
  46.             GgetVerifyImage();
  47.         }
  48.         private void butVerify_Click(object sender, EventArgs e)
  49.         {
  50.             GgetVerifyImage();
  51.         }
  52.         private void btnsubmit_Click(object sender, EventArgs e)
  53.         {
  54.             Thread thread1 = new Thread(new ThreadStart(PostVerify));
  55.             thread1.IsBackground = false;
  56.             thread1.Start();
  57.         }
  58.         private void PostVerify()
  59.         {
  60.             this.Invoke((MethodInvoker)delegate
  61.             {
  62.                 panel1.Enabled = false;
  63.                 string verifyCode = txtVerify.Text;
  64.                 string url = "http://nc.qzone.qq.com/cgi-bin/cgi_farm_index?mod=user&act=run&ownerId="+_uid+"&validatemsg=" + verifyCode;
  65.                 //string url = "http://happyfarm.qzone.qq.com/api.php?mod=friend";
  66.                 
  67.                 string farmtime = FarmKey.GetFarmTime();
  68.                 //validatemsg=swnw&uIdx=361157088&cIds=31%2C40%2C41%2C101&farmTime=1259974536&uId=361157088&farmKey=94500a55ae0a93b960df291449238a1c
  69.                 string postData = "uIdx=" + _uid + "&validatemsg=" + verifyCode + "&farmTime=" + farmtime + "&farmKey=" + FarmKey.GetFarmKey(farmtime);
  70.                 string asd = HttpHelper.GetHtml(url,cookie);
  71.                 if (asd != "")
  72.                 {
  73.  
  74.                 }
  75.                 this.Dispose();
  76.                 this.Close();
  77.             });
  78.         }
  79.         private void txtVerify_KeyDown(object sender, KeyEventArgs e)
  80.         {
  81.             if (e.KeyCode == Keys.Enter)
  82.             {
  83.                 EventArgs es=new EventArgs();
  84.                 btnsubmit_Click(sender, es);
  85.             } 
  86.         }
  87.     }
  88. }