Exemplo n.º 1
0
    static public void accountEx_getlist()
    {
        try
        {
            String   URL = Config.ROOT_URL + "accountex_getlist";
            PostData nvc = new PostData();
            Func.putPassWord(nvc);
            nvc.Add("start", "0");
            nvc.Add("count", "0");
            //nvc.Add("tag", "qq");
            //nvc.Add("tagval", "251197161");
            if (nvc != null)
            {
                string sttuas = Func.HttpPostData(URL, 10000, nvc);
                if (sttuas.Length > 10)
                {
                    MyJson.JsonNode_Array jsons = MyJson.Parse(sttuas) as MyJson.JsonNode_Array;
                    for (int i = 0; i < jsons.GetListCount(); i++)
                    {
                        MyJson.JsonNode_Object json = jsons.GetArrayItem(i) as MyJson.JsonNode_Object;
                        QQAccountEx            info = new QQAccountEx();
                        info.qq = json["qq"].AsString();
                        //info.state = Func.MyUrlDeCode(json["state"].AsString());
                        // info.locktime = Func.MyUrlDeCode(json["locktime"].AsString());

                        lsQQAccountEx.Add(info);
                    }
                }
            }
        }
        catch (Exception)
        {
        }
    }
Exemplo n.º 2
0
        public override void Enter()
        {
            HtmlElementCollection body = webBrowser1.Document.GetElementsByTagName("body");

            privilege = true;
            for (int i = 0; i < body.Count; ++i)
            {
                if (body[i].GetAttribute("className") == "no_privilege proj_limit_v2")
                {
                    privilege = false;
                    break;
                }
            }

            if (!privilege)
            {
                String user_name = "";
                String user_sex  = "";
                HtmlElementCollection user_infor = webBrowser1.Document.GetElementsByTagName("div");
                for (int i = 0; i < user_infor.Count; ++i)
                {
                    if (user_infor[i].GetAttribute("className") == "user_infor")
                    {
                        HtmlElementCollection childels = user_infor[i].All;
                        for (int j = 0; j < childels.Count; ++j)
                        {
                            if (childels[j].TagName == "p" || childels[j].TagName == "P")
                            {
                                if (childels[j].GetAttribute("className") == "user_name")
                                {
                                    user_name = childels[j].InnerText;
                                }
                                else
                                {
                                    if (childels[j].InnerText != null && childels[j].InnerText.Length > 0)
                                    {
                                        String[] p = childels[j].InnerText.Split(' ');
                                        if (p != null && p.Length > 0)
                                        {
                                            user_sex = p[0];
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                //存入数据库,调到下一个(只修改部分数据)
                PostData data = new PostData();
                data.Add("qq", spider.UIDB.qq);
                data.Add("used", 1);
                data.Add("nickname", user_name);
                data.Add("sex", user_sex);
                data.Add("zone_authority", 0);
                updateDBinfoThread.start(Config.UPDATE_ZONE_URL, data);
            }
        }
Exemplo n.º 3
0
        private void downloadUserInfo()
        {
            try{
                PostData nvc = new PostData();
                Func.putPassWord(nvc);
                //nvc.Add("order", "logintime");
                //nvc.Add("desc", "DESC");
                nvc.Add("start", "0");
                nvc.Add("count", "100");
                nvc.Add("tag", "used");
                nvc.Add("tagval", "0");
                if (nvc != null)
                {
                    string sttuas = Func.HttpPostData(Config.GETLIST_ZONE_URL, 10000, nvc);
                    if (sttuas.Length > 10)
                    {
                        this.listBox1.Items.Clear();
                        MyJson.JsonNode_Array jsons = MyJson.Parse(sttuas) as MyJson.JsonNode_Array;
                        for (int i = 0; i < jsons.GetListCount(); i++)
                        {
                            MyJson.JsonNode_Object json = jsons.GetArrayItem(i) as MyJson.JsonNode_Object;
                            UserInfoDB             info = new UserInfoDB();
                            info.qq               = json["qq"].AsString();
                            info.pqq              = json["pqq"].AsString();
                            info.nickname         = Func.MyUrlDeCode(json["nickname"].AsString());
                            info.age              = json["age"].AsInt();
                            info.sex              = Func.MyUrlDeCode(json["sex"].AsString());
                            info.birthday         = Func.MyUrlDeCode(json["birthday"].AsString());
                            info.mood             = json["mood"].AsInt();
                            info.photo            = json["photo"].AsInt();
                            info.blog             = json["blog"].AsInt();
                            info.heat             = json["heat"].AsInt();
                            info.zone_authority   = json["zone_authority"].AsInt();
                            info.friend_authority = json["friend_authority"].AsInt();
                            info.logintime        = Func.MyUrlDeCode(json["logintime"].AsString());
                            info.label            = Func.MyUrlDeCode(json["label"].AsString());
                            info.addfriend        = json["addfriend"].AsInt();
                            info.used             = json["used"].AsInt();
                            dblist.Add(info);

                            this.listBox1.Items.Add(info.qq);
                        }
                    }
                }
            }

            catch (Exception e)
            {
                LogFile.add(e.ToString(), "Stopping.cs:updateUserInfo", 1);
            }
        }
Exemplo n.º 4
0
        private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                PostData nvc = new PostData();
                Func.putPassWord(nvc);
                //nvc.Add("order", "heat");
                //nvc.Add("desc", "DESC");
                nvc.Add("fields", "qq,nickname");
                nvc.Add("count", "10");
                if (nvc != null)
                {
                    string sttuas = Func.HttpPostData(Config.LOCKQQ_ZONE_URL, 10000, nvc);
                    if (!sttuas.Contains("_fail_"))
                    {
                        MyJson.JsonNode_Array jsons = MyJson.Parse(sttuas) as MyJson.JsonNode_Array;
                        for (int i = 0; i < jsons.GetListCount(); i++)
                        {
                            MyJson.JsonNode_Object json = jsons.GetArrayItem(i) as MyJson.JsonNode_Object;
                            UserInfoDB             info = new UserInfoDB();
                            //每一个参数必须 Func.MyUrlDeCode();
                            info.qq = Func.MyUrlDeCode(json["qq"].AsString());
                            //info.pqq = json["pqq"].AsString();
                            info.nickname = Func.MyUrlDeCode(json["nickname"].AsString());
//                             info.age = json["age"].AsInt();
//                             info.sex = Func.MyUrlDeCode(json["sex"].AsString());
//                             info.birthday = Func.MyUrlDeCode(json["birthday"].AsString());
//                             info.mood = json["mood"].AsInt();
//                             info.photo = json["photo"].AsInt();
//                             info.blog = json["blog"].AsInt();
//                             info.heat = json["heat"].AsInt();
//                             info.zone_authority = json["zone_authority"].AsInt();
//                             info.friend_authority = json["friend_authority"].AsInt();
//                             info.logintime = Func.MyUrlDeCode(json["logintime"].AsString());
//                             info.label = Func.MyUrlDeCode(json["label"].AsString());
//                             info.addfriend = json["addfriend"].AsInt();
//                             info.used = json["used"].AsInt();
                        }
                    }
                }
            }

            catch (Exception)
            {
            }
        }
Exemplo n.º 5
0
 static public void account_update()
 {
     try
     {
         String   URL = Config.ROOT_URL + "account_update";
         PostData nvc = new PostData();
         Func.putPassWord(nvc);
         nvc.Add("qq", "251197161");
         nvc.Add("password", "mm21010");
         nvc.Add("nickname", "哈哈大饭店");
         nvc.Add("question1", "question1");
         nvc.Add("question3", "question3");
         nvc.Add("answer1", "answer1");
         nvc.Add("friendcount", "888");
         if (nvc != null)
         {
             string sttuas = Func.HttpPostData(URL, 10000, nvc);
             if (sttuas.Contains("_succ_"))
             {
             }
         }
     }
     catch (Exception)
     {
     }
 }
Exemplo n.º 6
0
        private void downloadUserInfo()
        {
            try
            {
                PostData nvc = new PostData();
                Func.putPassWord(nvc);
                nvc.Add("order", "time");
                nvc.Add("desc", "DESC");
                nvc.Add("start", "0");
                nvc.Add("count", "0");
                if (nvc != null)
                {
                    string sttuas = Func.HttpPostData(Config.GETLIST_ZONE_URL, 10000, nvc);
                    if (sttuas.Length > 10)
                    {
                        MyJson.JsonNode_Array jsons = MyJson.Parse(sttuas) as MyJson.JsonNode_Array;
                        for (int i = 0; i < jsons.GetListCount(); i++)
                        {
                            MyJson.JsonNode_Object json = jsons.GetArrayItem(i) as MyJson.JsonNode_Object;
                            UserInfoDB             info = new UserInfoDB();
                            info.qq = json["qq"].AsString();
                            // info.nickname   = json["nickname"].AsString();
                            //info.age = json["age"].AsString();
                            //info.sex = json["sex"].AsString();
                            //info.birthday = json["birthday"].AsString();
                            //info.mood = json["mood"].AsString();
                            //info.photo = json["photo"].AsString();
                            //info.blog = json["blog"].AsString();
                            //info.time = json["time"].AsString();
                            //info.key = json["key"].AsString();
                            //info.heat = json["heat"].AsString();
                            //info.usedcount = json["usedcount"].AsInt();
                            dblist.Enqueue(info);
                        }
                    }
                }
            }

            catch (Exception e)
            {
                LogFile.add(e.ToString(), "Stopping.cs:updateUserInfo", 1);
            }
        }
Exemplo n.º 7
0
 static public void accountEx_update()
 {
     try
     {
         String   URL = Config.ROOT_URL + "accountex_update";
         PostData nvc = new PostData();
         Func.putPassWord(nvc);
         nvc.Add("qq", "251197161");
         nvc.Add("state", "非常好");
         nvc.Add("locktime", "一万年前");
         if (nvc != null)
         {
             string sttuas = Func.HttpPostData(URL, 10000, nvc);
             if (sttuas.Contains("_succ_"))
             {
             }
         }
     }
     catch (Exception)
     {
     }
 }
Exemplo n.º 8
0
        private void DownloadFriendQQ()
        {
            while (friends.Count == 0)
            {
                try
                {
                    PostData nvc = new PostData();
                    Func.putPassWord(nvc);
                    //nvc.Add("order", "heat");
                    //nvc.Add("desc", "DESC");
                    nvc.Add("fields", "qq");
                    nvc.Add("count", "250");
                    if (nvc != null)
                    {
                        string sttuas = Func.HttpPostData(Config.LOCKQQ_ZONE_URL, 10000, nvc);
                        if (!sttuas.Contains("_fail_"))
                        {
                            MyJson.JsonNode_Array jsons = MyJson.Parse(sttuas) as MyJson.JsonNode_Array;
                            for (int i = 0; i < jsons.GetListCount(); i++)
                            {
                                MyJson.JsonNode_Object json = jsons.GetArrayItem(i) as MyJson.JsonNode_Object;
                                friends.Enqueue(Func.MyUrlDeCode(json["qq"].AsString()));
                            }
                        }
                    }
                }
                catch (Exception e)
                {
                    Debug.OnException(e);
                }

                if (friends.Count == 0)
                {
                    System.Threading.Thread.Sleep(5000);
                    Debug.LogError("获取要加的QQ失败了,是不是完了?或者网络出什么问题啦!!");
                }
            }
        }
Exemplo n.º 9
0
    static public void test_updateqq_from_spider()
    {
        try
        {
            //加载文件
            Queue <string> qqs  = new Queue <string>();
            string         strs = File.ReadAllText("未处理.txt");
            string[]       _qqs = strs.Split(new char[] { '\n', '\t' });
            for (int i = 0; i < _qqs.Length; ++i)
            {
                if (_qqs[i].Length > 1)
                {
                    qqs.Enqueue(_qqs[i]);
                }
            }

            String URL = Config.ROOT_URL + "test_updateqq";
            while (qqs.Count > 0)
            {
                String strqqs = test_updateqq_getqqs(qqs);

                PostData nvc = new PostData();
                Func.putPassWord(nvc);
                nvc.Add("qqs", strqqs);
                if (nvc != null)
                {
                    Console.WriteLine("\n剩余:【" + qqs.Count + "】");
                    string sttuas = Func.HttpPostData(URL, 10000, nvc);
                    if (sttuas.Length > 10)
                    {
                        MyJson.JsonNode_Object json = MyJson.Parse(sttuas) as MyJson.JsonNode_Object;
                        String succ      = json["succ"].AsString();
                        int    succcount = succ.Split('[').Length - 1;

                        String fail      = json["fail"].AsString();
                        int    failcount = fail.Split('[').Length - 1;

                        int all = succcount + failcount;

                        Console.WriteLine("插入成功:" + succcount + "/" + all + " " + succ);
                        Console.WriteLine("插入失败:" + failcount + "/" + all + " " + fail);
                    }
                }
                System.Threading.Thread.Sleep(100);
            }
        }
        catch (Exception)
        {
        }
    }
Exemplo n.º 10
0
 static public void friend_update()
 {
     try
     {
         String   URL = Config.ROOT_URL + "friend_update";
         PostData nvc = new PostData();
         Func.putPassWord(nvc);
         nvc.Add("qq", "251197161");
         nvc.Add("qqfri", "7777");
         nvc.Add("addtime", "2015-10-28 17:25:00");
         nvc.Add("state", "申请中");
         if (nvc != null)
         {
             string sttuas = Func.HttpPostData(URL, 10000, nvc);
             if (sttuas.Contains("_succ_"))
             {
             }
         }
     }
     catch (Exception)
     {
     }
 }
Exemplo n.º 11
0
        public void Process()
        {
            FullRequest = StringBuilder.ToString();
            var lines = new List <string>(Regex.Split(FullRequest, "\r\n"));

            if (lines != null && lines.Count > 2)
            {
                var requestLine = lines[0].Split(' ');
                if (requestLine.Length == 3)
                {
                    Method = requestLine[0];
                    var requestedPage = requestLine[1].Split('?');
                    if (requestedPage.Length == 2)
                    {
                        var getData = requestedPage[1].Split('&');
                        foreach (var kvp in getData)
                        {
                            var _kvp = kvp.Split('=');
                            if (_kvp.Length == 2 && !GetData.ContainsKey(_kvp[0]))
                            {
                                GetData.Add(_kvp[0], _kvp[1]);
                            }
                        }
                    }
                    RequestedPage = requestedPage[0];
                }

                int contentIndex = lines.IndexOf(string.Empty) + 1;
                if (contentIndex > 0 && contentIndex < lines.Count)
                {
                    for (int i = contentIndex; i < lines.Count; i++)
                    {
                        var line = lines[i].Split('=');
                        if (line.Length == 2 && !PostData.ContainsKey(line[0]))
                        {
                            PostData.Add(line[0], line[1]);
                        }
                    }
                }
            }
        }
Exemplo n.º 12
0
    static public void account_getlist()
    {
        try
        {
            String   URL = Config.ROOT_URL + "account_getlist";
            PostData nvc = new PostData();
            Func.putPassWord(nvc);
            nvc.Add("order", "logintime");
            nvc.Add("desc", "DESC");
            nvc.Add("start", "0");
            nvc.Add("count", "0");
            nvc.Add("tag", "loginip");
            nvc.Add("tagval", "127.0.0.1");
            if (nvc != null)
            {
                string sttuas = Func.HttpPostData(URL, 10000, nvc);
                if (sttuas.Length > 10)
                {
                    MyJson.JsonNode_Array jsons = MyJson.Parse(sttuas) as MyJson.JsonNode_Array;
                    for (int i = 0; i < jsons.GetListCount(); i++)
                    {
                        MyJson.JsonNode_Object json = jsons.GetArrayItem(i) as MyJson.JsonNode_Object;
                        QQAccount info = new QQAccount();
                        info.qq          = json["qq"].AsString();
                        info.password    = Func.MyUrlDeCode(json["password"].AsString());
                        info.nickname    = Func.MyUrlDeCode(json["nickname"].AsString());
                        info.loginip     = Func.MyUrlDeCode(json["loginip"].AsString());
                        info.canuse      = json["canuse"].AsInt();
                        info.phonenumber = json["phonenumber"].AsString();
                        info.owner       = Func.MyUrlDeCode(json["owner"].AsString());
                        info.question1   = Func.MyUrlDeCode(json["question1"].AsString());
                        info.question2   = Func.MyUrlDeCode(json["question2"].AsString());
                        info.question3   = Func.MyUrlDeCode(json["question3"].AsString());
                        info.answer1     = Func.MyUrlDeCode(json["answer1"].AsString());
                        info.answer2     = Func.MyUrlDeCode(json["answer2"].AsString());
                        info.answer3     = Func.MyUrlDeCode(json["answer3"].AsString());

                        lsQQAccount.Add(info);
                    }
                }
            }
        }
        catch (Exception)
        {
        }
    }
Exemplo n.º 13
0
        protected override HttpWebRequest CreateWebRequest(StreamingAPIParameters p)
        {
            PostData.Add(ConstructPostData(p));

            var request = (HttpWebRequest)WebRequest.Create(StreamRequestUrl);

            request.Method      = "POST";
            request.ContentType = "application/x-www-form-urlencoded";

            var header = CreateAuthHeader(request);

            request.Headers.Add("Authorization", header.GetHeaderString());

            using (var sw = new StreamWriter(request.GetRequestStream()))
            {
                string encoded = HttpUtil.EncodeFormPostData(PostData);
                if (!string.IsNullOrEmpty(encoded))
                {
                    sw.Write(encoded);
                }
            }

            return(request);
        }
Exemplo n.º 14
0
        private void button4_Click(object sender, EventArgs e)
        {
            try
            {
                PostData nvc = new PostData();
                Func.putPassWord(nvc);
                nvc.Add("qq", "1002027357");
                //nvc.Add("lockip", "ok");
                if (nvc != null)
                {
                    string sttuas = Func.HttpPostData(Config.UNLOCKEQQ_ZONE_URL, 10000, nvc);
                    if (sttuas != null)
                    {
                        if (sttuas.Contains("_succ_"))
                        {
                        }
                    }
                }
            }

            catch (Exception)
            {
            }
        }
Exemplo n.º 15
0
        public static PostData userInfo2PostData(UserInfoDB info)
        {
            if (info == null)
            {
                return(null);
            }
            PostData nvc = new PostData();

            Func.putPassWord(nvc);
            nvc.Add("qq", info.qq);
            nvc.Add("pqq", info.pqq);
            nvc.Add("nickname", info.nickname);
            nvc.Add("age", info.age);
            nvc.Add("sex", info.sex);
            nvc.Add("birthday", info.birthday);
            nvc.Add("mood", info.mood);
            nvc.Add("photo", info.photo);
            nvc.Add("blog", info.blog);
            nvc.Add("heat", info.heat);
            nvc.Add("zone_authority", info.zone_authority);
            nvc.Add("friend_authority", info.friend_authority);
            nvc.Add("logintime", info.logintime);
            nvc.Add("label", info.label);
            nvc.Add("addfriend", info.addfriend);
            nvc.Add("used", info.used);
            return(nvc);
        }
Exemplo n.º 16
0
        private void downloadUserInfo()
        {
            try
            {
#if DEBUG
                String[] qqs =
                {
                    //"1532931245",
                    //"657565846",
                    "2517172830",
                    //"305723370",
                    //"947087352",
                };
                for (int i = 0; i < qqs.Length; i++)
                {
                    UserInfoDB info = new UserInfoDB();
                    info.qq = qqs[i];
                    dblist.Add(info);
                }
#else
                PostData nvc = new PostData();
                Func.putPassWord(nvc);
                nvc.Add("order", "time");
                nvc.Add("desc", "DESC");
                nvc.Add("start", "0");
                nvc.Add("count", "0");
                if (nvc != null)
                {
                    string sttuas = Func.HttpPostData(Config.GETLIST_ZONE_URL, 10000, nvc);
                    if (sttuas.Length > 10)
                    {
                        MyJson.JsonNode_Array jsons = MyJson.Parse(sttuas) as MyJson.JsonNode_Array;
                        for (int i = 0; i < jsons.GetListCount(); i++)
                        {
                            MyJson.JsonNode_Object json = jsons.GetArrayItem(i) as MyJson.JsonNode_Object;
                            UserInfoDB             info = new UserInfoDB();
                            info.qq               = json["qq"].AsString();
                            info.pqq              = json["pqq"].AsString();
                            info.nickname         = Func.MyUrlDeCode(json["nickname"].AsString());
                            info.age              = json["age"].AsInt();
                            info.sex              = Func.MyUrlDeCode(json["sex"].AsString());
                            info.birthday         = Func.MyUrlDeCode(json["birthday"].AsString());
                            info.mood             = json["mood"].AsInt();
                            info.photo            = json["photo"].AsInt();
                            info.blog             = json["blog"].AsInt();
                            info.heat             = json["heat"].AsInt();
                            info.zone_authority   = json["zone_authority"].AsInt();
                            info.friend_authority = json["friend_authority"].AsInt();
                            info.logintime        = Func.MyUrlDeCode(json["logintime"].AsString());
                            info.label            = Func.MyUrlDeCode(json["label"].AsString());
                            info.addfriend        = json["addfriend"].AsInt();
                            info.used             = json["used"].AsInt();
                            dblist.Add(info);
                        }
                    }
                }
#endif
            }
            catch (Exception e)
            {
                LogFile.add(e.ToString(), "Stopping.cs:updateUserInfo", 1);
            }
        }
Exemplo n.º 17
0
        void InitializeAccount()
        {
            try
            {
                String   URL = Config.ROOT_URL + "account_getlist";
                PostData nvc = new PostData();
                Func.putPassWord(nvc);
                nvc.Add("order", "logintime");
                nvc.Add("desc", "DESC");
                nvc.Add("start", "0");
                nvc.Add("count", "100");
                nvc.Add("tag", "loginip");
                string ip = Tools.GetIP();
                nvc.Add("tagval", ip);

                Debug.LogLine("本机IP:" + ip);
                if (nvc != null)
                {
                    string sttuas = Func.HttpPostData(URL, 10000, nvc);
                    Debug.Log(sttuas);
                    if (sttuas.Length > 10)
                    {
                        MyJson.JsonNode_Array jsons = MyJson.Parse(sttuas) as MyJson.JsonNode_Array;
                        for (int i = 0; i < jsons.GetListCount(); i++)
                        {
                            MyJson.JsonNode_Object json = jsons.GetArrayItem(i) as MyJson.JsonNode_Object;
                            int canuse = json["canuse"].AsInt();
                            if (canuse == 1)
                            {
                                QQInfo info = new QQInfo();
                                info.qq       = json["qq"].AsString();
                                info.pws      = Func.MyUrlDeCode(json["password"].AsString());
                                info.nickname = Func.MyUrlDeCode(json["nickname"].AsString());

                                if (!qqInfo.ContainsKey(info.qq))
                                {
                                    qqinfo.Enqueue(info.qq);
                                    qqInfo.Add(info.qq, info);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Debug.OnException(e);
            }


            try
            {
                String   URL = Config.ROOT_URL + "accountex_getlist";
                PostData nvc = new PostData();
                Func.putPassWord(nvc);
                nvc.Add("start", "0");
                nvc.Add("count", "0");
                //nvc.Add("tag", "qq");
                //nvc.Add("tagval", "251197161");
                if (nvc != null)
                {
                    string sttuas = Func.HttpPostData(URL, 10000, nvc);
                    if (sttuas.Length > 10)
                    {
                        MyJson.JsonNode_Array jsons = MyJson.Parse(sttuas) as MyJson.JsonNode_Array;
                        for (int i = 0; i < jsons.GetListCount(); i++)
                        {
                            MyJson.JsonNode_Object json = jsons.GetArrayItem(i) as MyJson.JsonNode_Object;
                            string qq = json["qq"].AsString();

                            QQInfo info;
                            if (qqInfo.TryGetValue(qq, out info))
                            {
                                info.state = Func.MyUrlDeCode(json["state"].AsString());
                                try
                                {
                                    info.locktime = DateTime.Now;
                                    info.locktime = DateTime.Parse(Func.MyUrlDeCode(json["locktime"].AsString()));
                                }
                                catch (Exception) { }
                            }
                        }
                    }
                }
            }
            catch (Exception)
            {
            }
        }