酷酷七友软件定做 酷酷七友软件

软件开发

qq空间刷人气源码公布

qq空间刷人气源码(C#)公布

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using byError.Json;
namespace byLeave
{
    public partial class frmMain : Form
    {
        public frmMain()
        {
            InitializeComponent();
        }
        string user = ""; string psw = "";
        private void button1_Click(object sender, EventArgs e)
        {

        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            timer1.Enabled = false;

        }

 

        private void frmMain_Load(object sender, EventArgs e)
        {
            lvwSender.Columns.Add("id", 50);
            lvwSender.Columns.Add("QQ号", 100);
            lvwSender.Columns.Add("密码", 100);
            lvwSender.Columns.Add("使用", 100);

            lvwSender.View = System.Windows.Forms.View.Details;
            lvwSender.GridLines = true;
            ListViewItem myItem = new ListViewItem();
            myItem.Text = "0";
            myItem.SubItems.Add("302777528");
            myItem.SubItems.Add("a20520500");
            myItem.SubItems.Add("0");
            lvwSender.Items.Add(myItem);
            //myItem = new ListViewItem();
            //myItem.Text = "1";
            //myItem.SubItems.Add("1427322846");
            //myItem.SubItems.Add("a205205");
            //myItem.SubItems.Add("1");
            //lvwSender.Items.Add(myItem);
        }

        private void checkBox3_CheckedChanged(object sender, EventArgs e)
        {

        }

        private void checkBox5_CheckedChanged(object sender, EventArgs e)
        {

        }

        private void button8_Click(object sender, EventArgs e)
        {

        }
        private void btnExit_Click(object sender, EventArgs e)
        {
            Thread th = new Thread(proTest);
            th.Start();


        }
        private delegate void testEvent();
        void proTest()
        {
            System.Diagnostics.Debug.Print("AA");
            this.BeginInvoke(new testEvent(bEvent));
            bEvent();
            System.Diagnostics.Debug.Print("CC");
        }
        void bEvent()
        {
            this.Text = "bb";
            System.Diagnostics.Debug.Print("BB");
        }
        SernderList[] senderList;
        struct SernderList
        {
            string _qq;
            public string qq
            { get { return _qq; } set { _qq = value; } }
            string _psw;
            public string psw
            { get { return _psw; } set { _psw = value; } }
        }

        private void btnStart_Click(object sender, EventArgs e)
        {
            senderList = new SernderList[lvwSender.Items.Count];
            for (int i = 0; i < lvwSender.Items.Count; i++)
            {
                senderList[i].qq = lvwSender.Items[i].SubItems[1].Text.ToString();
                senderList[i].psw = lvwSender.Items[i].SubItems[2].Text.ToString();
                app.Container1[senderList[i].qq] = new System.Net.CookieContainer();

            }
            //一个线程就行了
            Thread th = new Thread(new ParameterizedThreadStart(proLogin));
            th.IsBackground = true;
            th.Start(new object[] { 0, senderList });

            return;

        }
        private delegate void BackState(int lx, string bState);
        void backState(int lx, string bState)
        {
            lblStatus.Text = string.Format("时间{0},状态{1}", DateTime.Now.ToShortDateString(), bState);
        }
        private delegate void BackEvent(int lx, object o);
        /// <summary>
        /// 返回事件
        /// </summary>
        /// <param name="lx">0 login手动输验证码 1 leaveWord验证码 2 登录成功返回(去留言,刷人气,刷日志) 3 登录不成功
        /// 4  case 4://留言,刷人气返回</param>
        /// <param name="o"></param>
        void backEvent(int lx, object o)
        {
            switch (lx)
            {
                case 0:
                    string key = o.ToString();
                    frmVerifyCode frmVCode = new frmVerifyCode(0, key);
                    frmVCode.ShowDialog();
                    app.isIgnorVCode_login = frmVCode.isIgnore;
                    app.vCode1[key] = frmVCode.strVcode;
                    //frmVCode
                    break;
                case 1:
                    string key1 = o.ToString();
                    frmVerifyCode frmVCode1 = new frmVerifyCode(1, key1);
                    frmVCode1.ShowDialog();
                    app.isIgnorVCode_lWord = frmVCode1.isIgnore;
                    app.vCode1[key1] = frmVCode1.strVcode;
                    break;
                case 2://登录成功,要处理的事情就多了
                    string fQQ = ((object[])o)[0].ToString();
                    int index = int.Parse((((object[])o)[1]).ToString());
                    SernderList[] sList = (SernderList[])((object[])o)[2];
                    ctrlLeaveHot(fQQ, new object[] { index, sList });
                    break;
                case 3://登录不成功
                    //一个线程就行了
                    Thread th = new Thread(new ParameterizedThreadStart(proLogin));
                    th.IsBackground = true;
                    th.Start(o);
                    break;
                case 4://留言,刷人气返
                    //判断留言,人气是否已完成,完成则循环下一个q
                    Thread th4 = new Thread(new ParameterizedThreadStart(proLogin));
                    th4.IsBackground = true;
                    th4.Start(o);
                 
                    break;
                case 5://刷空间单次返回
                    VisitCount vCount = (VisitCount)JavaScriptConvert.DeserializeObject(o.ToString(),typeof(VisitCount));
                    lblrain.Text = vCount.rain; lbllove.Text = vCount.love;
                    lblsun.Text = vCount.sun; lblnutri.Text = vCount.nutri;
                    lbldayvisit.Text = vCount.dayvisit;
                    lblvisitcount.Text = vCount.visitcount;
                    break;
                default:
                    return;
            }
        }
        void proLogin(object o)
        {
            //可检查是否完成
            int i = int.Parse(((object[])o)[0].ToString());
            SernderList[] sList = (SernderList[])((object[])o)[1];//发送者列表
            string fQQ = sList[i].qq;
            string fPsw = sList[i].psw;
            string vCode = userHelper.AutoGetVerifyCode(fQQ);
            if (vCode.Length != 4)//验证码失败
            {
                if (app.isIgnorVCode_login == 2)
                {
                    this.BeginInvoke(new BackState(backState), 0, "已启用忽略验证码,正在使用下一个q继续!!");

                    continue;//全部忽略验证码
                }
                this.BeginInvoke(new BackState(backState), 0, "自动填验证码失败!!");
                //手动
                app.vCode1[fQQ] = vCode;
                this.Invoke(new BackEvent(backEvent), 0, fQQ);//将要等它返回才执行以下内容
                vCode = app.vCode1[fQQ];
                if (app.isIgnorVCode_login == 1)
                {
                    this.BeginInvoke(new BackEvent(backEvent), 0, "已暂时跳过验证码,正在使用下一个q继续。。");
                    continue;
                }
            }
            else
            {
                this.BeginInvoke(new BackState(backState), 0, "自动填验证码成功,正在登录。。。");
            }
            string strLogin = userHelper.Login(fQQ, fPsw, vCode);
            if (strLogin.IndexOf("成功") != -1)
            {
                this.BeginInvoke(new BackState(backState), 0, string.Format("q号{0}登录成功!!", fQQ));
                this.BeginInvoke(new BackEvent(backEvent), 2, new object[] { fQQ, i + 1, senderList });
            }
            else
            {
                //登录失败,不重试
                this.BeginInvoke(new BackState(backState), 0, string.Format("q号:{0},操作:登录,状态:{1},正在使用下一个q号工作..", fQQ, strLogin));
                this.BeginInvoke(new BackEvent(backEvent), 3, new object[] { i + 1, senderList });
            }


            System.Diagnostics.Debug.Print(strLogin);


        }
        //控制留言和刷人气
        void ctrlLeaveHot(string fQQ, object o)
        {
            //应判断是否刷
            if (radBothRH.Checked || radLeaveWord.Checked)
            {
                Thread th0 = new Thread(new ParameterizedThreadStart(proLeaveWord));
                th0.IsBackground = true;
                th0.Start(new object[] { fQQ, "", o });
            }
            if (radBothRH.Checked || radHotZone.Checked)
            {
                string tQQ = txtHotNum.Text.Trim();
               if(string.IsNullOrEmpty(tQQ))
                {
                    tQQ = "302777528";//默认到
                    this.BeginInvoke(new BackState(backState), 4,string.Format("警告:您没输入待刷q号,将刷默认的Q:{0}, tQQ"));
                    //MessageBox.Show("请输入待刷的Q号", "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                //三线程吧,1 hotZone,2hotdiary 3 garden(1,3合并一线程)
                if (ckHotZone.Checked)
                {
                 Thread th1 = new Thread(new ParameterizedThreadStart(proHotZone));
                th1.IsBackground = true;
                th1.Start(new object[] { fQQ, "", o });
                }
                if (ckHotDiary.Checked)
                {
                 Thread th2 = new Thread(new ParameterizedThreadStart(proHotDiary));
                th2.IsBackground = true;
                th2.Start(new object[] { fQQ, "", o });
                }  
            }


        }
        void proLeave(object o)
        {
            SernderList[] sList = (SernderList[])((object[])o)[0];
            int iBegin = int.Parse(((object[])o)[1].ToString());
            int iEnd = int.Parse(((object[])o)[2].ToString());
            int iThread = int.Parse(((object[])o)[3].ToString());
            for (int i = iBegin; i < iEnd; i++)
            {
                string fQQ = sList[i].qq;
                string fPsw = sList[i].psw;
                string vCode = userHelper.AutoGetVerifyCode(fQQ);
                if (vCode.Length != 4)//验证码失败
                {
                    if (app.isIgnorVCode_login == 2)
                    {
                        this.BeginInvoke(new BackState(backState), 0, "已启用忽略验证码,正在使用下一个q继续!!");

                        continue;//全部忽略验证码
                    }
                    this.BeginInvoke(new BackState(backState), 0, "自动填验证码失败!!");
                    //手动
                    app.vCode1[fQQ] = vCode;
                    this.Invoke(new BackEvent(backEvent), 0, fQQ);//将要等它返回才执行以下内容
                    vCode = app.vCode1[fQQ];
                    if (app.isIgnorVCode_login == 1)
                    {
                        this.BeginInvoke(new BackEvent(backEvent), 0, "已暂时跳过验证码,正在使用下一个q继续。。");
                        continue;
                    }
                }
                else
                {
                    this.BeginInvoke(new BackState(backState), 0, "自动填验证码成功,正在登录。。。");
                }
                string strLogin = userHelper.Login(fQQ, fPsw, vCode);
                if (strLogin.IndexOf("成功") != -1)
                {
                    this.BeginInvoke(new BackState(backState), 0, string.Format("q号{0}登录成功!!", fQQ));
                }
                else
                {
                    this.BeginInvoke(new BackState(backState), 0, string.Format("q号:{0},操作:登录,状态:{1},正在使用下一个q号工作..", fQQ, strLogin));
                    continue;
                }
                //visitCount 100次
                {
                    //用event搞 delegate另开线程

                }

                System.Diagnostics.Debug.Print(strLogin);
                //for (int j = 0; j < 9; j++)
                //{
                //    string tQQ = "314459485";
                //    string strLeaveWord = userHelper.LeaveWord(fQQ, tQQ, "i'm ok" + DateTime.Now.ToShortDateString(), "");
                //    System.Diagnostics.Debug.Print(strLeaveWord);
                //    this.BeginInvoke(new BackState(backState), 1,string.Format("{0}给{1}留言》》{2}",fQQ,tQQ,strLeaveWord));
                //  //留言部分应该在另一个void里,这样可以回调(验证码出错时让它回调)
                //    Thread.Sleep(1000);
                //}
                //刷完留言要等待,空间人气的返回
                for (int j = 0; j < 9; j++)
                    leaveWord(fQQ, "");
            }
        }
        //留言
        void proLeaveWord(object o)
        {
            string fQQ = ((object[])o)[0].ToString();
            string vCode = ((object[])o)[1].ToString();
            object oo = ((object[])o)[2];
            string tQQ = "314459485";
            string strLeaveWord = "";
            strLeaveWord = userHelper.LeaveWord(fQQ, tQQ, "i'm ok" + DateTime.Now.ToShortDateString(), vCode);
            System.Diagnostics.Debug.Print(strLeaveWord);
            this.BeginInvoke(new BackState(backState), 1, string.Format("{0}给{1}留言》》{2}", fQQ, tQQ, strLeaveWord));
            if (strLeaveWord.IndexOf("验证码") != -1)
            {
                if (app.isIgnorVCode_lWord == 2)
                {
                    this.BeginInvoke(new BackState(backState), 1, "已启用忽略验证码,正在使用下一个q继续!!");

                    return;//全部忽略验证码
                }
                this.Invoke(new BackEvent(backEvent), 1, fQQ);
                if (app.isIgnorVCode_lWord == 1)
                {
                    this.BeginInvoke(new BackEvent(backEvent), 1, "已暂时跳过验证码,正在使用下一个q继续。。");
                    return;
                }
                //回调
                proLeaveWord(fQQ, app.vCode1[fQQ],oo);
                return;
            }
            //留言完成
            Thread.Sleep(1000);
            this.BeginInvoke(new BackEvent(backEvent), 4, oo);

        }
        //刷人气,garden
        void proHotZone(object o)
        {
            string fQQ=((object[])o)[0].ToString();
            string tQQ="302777528";
            //garden
            userHelper.careGarden("rain", tQQ);  Thread.Sleep(500);
            userHelper.careGarden("nutri", tQQ); Thread.Sleep(500);
            userHelper.careGarden("sun", tQQ); Thread.Sleep(500);
            userHelper.careGarden("love", tQQ); Thread.Sleep(500);

            //.......
            //刷空间
            int iFailure=0;
            for (int i = 0; i < 100; i++)
            {
                Thread.Sleep(1000);
                string tmpstr = userHelper.VisitZone(fQQ, tQQ);
                if (string.IsNullOrEmpty(tmpstr))
                {
                    this.BeginInvoke(new BackState(backState), 4, string.Format("警告:用{0}刷{1}空间人气时出错,错误次数{2}", fQQ, tQQ, iFailure));
                    iFailure++;

                    continue;
                    if (iFailure >= 4)
                    {
                        this.BeginInvoke(new BackState(backState), 4, string.Format("警告:用{0}刷{1}空间人气时出错次数过多,已停止", fQQ, tQQ));
                        break;
                    }
                }
                else
                {
                    this.BeginInvoke(new BackEvent(backEvent),5,tmpstr);
                }
            }
            //刷完要返回

        }
        //刷日志
        void proHotDiary()
        {

        }
        private void groupBox2_Enter(object sender, EventArgs e)
        {

        }
        //获取日志列表 绑定到combox
        private void lblDiaryList_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            // if (lblDiaryList.Enabled && btnStart.Enabled)
            {
                if (string.IsNullOrEmpty(txtHotNum.Text.Trim()))
                {
                    MessageBox.Show("请先输入待刷的Q号", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                lblDiaryList.Enabled = false;
                //Text = "提示信息:正在获取日志列表,请稍候...";
                // Thread th = new Thread(new ThreadStart(proDiaryList));
                Thread th = new Thread(new ParameterizedThreadStart(proDiaryList));
                th.IsBackground = true;
                th.Start(new object[] { txtHotNum.Text.Trim() });

            }
        }

        void proDiaryList(string toQQ)
        {
            //要传一个已登录的号过去
            string str = userHelper.getDiaryList(txtHotNum.Text.Trim());
            if (string.IsNullOrEmpty(str))
            {
               // lblDiaryInfo.Text = "获取日志列表时出现未知错误,请检查网络情况后重试";
                this.BeginInvoke(new BackState(backState), 3, "获取日志列表时出现未知错误,请检查网络情况后重试");
                lblDiaryList.Enabled = true;
                return;
            }
            if (str.IndexOf("无权访问") != -1)
            {
               // lblDiaryInfo.Text = "您无权访问该空间,请用该空间的好友帐号登录后再获取日志列表!";
                this.BeginInvoke(new BackState(backState), 3, "您无权访问该空间,请先将该空间权限设置为任何人可访问!");
                lblDiaryList.Enabled = true;
 
                return;
            }
        }

        private void groupBox6_Enter(object sender, EventArgs e)
        {

        }

    }
}
  Powered BY Error Q:302777528 http://www.qq7u.com