private void btnRetrieve_Click(object sender, EventArgs e)
        {
            // UpdatePwdByEmail | 用户密码找回
            var url = "http://w.eydata.net/e82b0f76670b450a"; //  这里改成自己的地址

            IDictionary <string, string> parameters = new Dictionary <string, string>();

            try
            {
                //  这里改成自己的参数名称
                parameters.Add("UserName", txtRetrieveUserName.Text);
                parameters.Add("Email", txtRetrieveEmail.Text);

                var ret = WebPost.ApiPost(url, parameters);

                if (int.Parse(ret) >= 1)
                {
                    MessageBox.Show("找回密码成功,请注意邮箱查收!");
                }
                else
                {
                    MessageBox.Show("找回密码失败,错误代码: " + ret);
                }
            }
            catch (Exception e22)
            {
                MyLogUtil.ErrToLog("异常原因," + e22);
                MessageBox.Show("网络连接失败!");
            }
        }
        private void button3_Click(object sender, EventArgs e)
        {
            // UpdatePwd | 修改用户密码
            var url = "http://w.eydata.net/5ff969d2bef16403"; //  这里改成自己的地址

            IDictionary <string, string> parameters = new Dictionary <string, string>();

            try
            {
                //  这里改成自己的参数名称
                parameters.Add("UserName", txtUpPwdUserName.Text);
                parameters.Add("UserPwd", txtUpPwd1.Text);
                parameters.Add("NewUserPwd", txtUpPwd2.Text);

                var ret = WebPost.ApiPost(url, parameters);

                if (int.Parse(ret) >= 1)
                {
                    MessageBox.Show("修改密码成功!");
                }
                else
                {
                    MessageBox.Show("修改密码失败,错误代码: " + ret);
                }
            }
            catch (Exception e21)
            {
                MyLogUtil.ErrToLog("异常原因," + e21);
                MessageBox.Show("网络连接失败!");
            }
        }
        private void btnRecharge_Click(object sender, EventArgs e)
        {
            // UserRecharge | 用户充值
            var url = "http://w.eydata.net/b6af9bff0a8a373c"; //  这里改成自己的地址

            IDictionary <string, string> parameters = new Dictionary <string, string>();

            try
            {
                //  这里改成自己的参数名称
                parameters.Add("UserName", txtReUserName.Text.Trim());
                parameters.Add("CardPwd", txtReCard.Text);
                parameters.Add("Referral", txtReReferral.Text);

                var ret = WebPost.ApiPost(url, parameters);

                if (int.Parse(ret) >= 1)
                {
                    MessageBox.Show("充值成功!");
                }
                else
                {
                    MessageBox.Show("充值失败,错误代码: " + ret);
                }
            }
            catch (Exception e20)
            {
                MyLogUtil.ErrToLog("异常原因," + e20);
                MessageBox.Show("网络连接失败!");
            }
        }
        private void btnReg_Click(object sender, EventArgs e)
        {
            // UserRegin | 用户注册 url
            var url = "http://w.eydata.net/cfe22fbe2935fc5e"; //  这里改成自己的地址

            IDictionary <string, string> parameters = new Dictionary <string, string>();

            try
            {
                //  这里改成自己的参数名称
                parameters.Add("UserName", txtRegUserName.Text.Trim());
                parameters.Add("UserPwd", txtRegPwd.Text);
                parameters.Add("Email", txtRegEmail.Text);
                parameters.Add("Mac", "");

                var ret = WebPost.ApiPost(url, parameters);

                if (ret == "1")
                {
                    MessageBox.Show("注册成功!");
                }
                else
                {
                    MessageBox.Show("注册失败,错误代码: " + ret);
                }
            }
            catch (Exception e19)
            {
                MyLogUtil.ErrToLog("异常原因," + e19);
                MessageBox.Show("网络连接失败!");
            }
        }
        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            // 程序关闭前退出登录
            IDictionary <string, string> parameters = new Dictionary <string, string>();
            //  退出登录(LogOut) url
            var url = "http://w.eydata.net/61b3173a01089775";  //  这里改成自己的地址

            //  这里改成自己的参数名称
            parameters.Add("StatusCode", ret);
            parameters.Add("UserName", loginUserName);
            var retValue = WebPost.ApiPost(url, parameters);

            if (retValue == "1")
            {
                // 退出成功,清除本地状态码
                www._52bang.site.yinliu.OperateIniFile.WriteIniData("root", "code", "", "config.ini");
            }
            Application.Exit();
        }
        //初始化基础配置
        private void InitConfig()
        {
            try
            {
                //GetBulletin | 获取程序公告
                String url1 = "http://w.eydata.net/a785c7d10885be26";  //  这里改成自己的地址
                IDictionary <string, string> parameters1 = new Dictionary <string, string>();
                //  这里改成自己的参数名称
                parameters1.Add("UserName", loginUserName);
                String ret1 = WebPost.ApiPost(url1, parameters1);

                if (ret1.Length > 0)
                {
                    CacheData.NotifyInfo = ret1;
                }


                // GetExpired | 获取用户的到期时间
                String url = "http://w.eydata.net/1f6208e5b7cc9208";  //  这里改成自己的地址
                IDictionary <string, string> parameters = new Dictionary <string, string>();
                //  这里改成自己的参数名称
                parameters.Add("UserName", loginUserName);

                ret = WebPost.ApiPost(url, parameters);

                if (ret.Length > 0)
                {
                    this.Text = this.Text + "  (" + loginUserName + ")过期时间:" + ret;
                }

                //加载解析接口
                CacheData.resourceApiList = MySystemUtil.GetVipParserApiList();


                this.skinComboBox1.ValueMember   = "index";
                this.skinComboBox1.DisplayMember = "moduleName";
                this.skinComboBox1.DataSource    = CacheData.linkList;

                this.skinComboBox2.ValueMember   = "index";
                this.skinComboBox2.DisplayMember = "moduleName";
                this.skinComboBox2.DataSource    = CacheData.resourceApiList;


                BaseJson    baseJson    = MySystemUtil.GetBaseJsonConfig();
                MovieConfig movieConfig = MySystemUtil.GetMovieJsonConfig();
                CacheData.BaseJson    = baseJson;
                CacheData.MovieConfig = movieConfig;
                //MyLogUtil.ToLog("coolQApi:"+ coolQApi);
                //初始群列表
                if (coolQApi == null)
                {
                    CacheData.GroupList = new List <www_52bang_site_enjoy.MyModel.GroupInfo>();
                }
                else
                {
                    //由于在这调用获取群列表时酷q初始化未完成,会导致抛异常
                    //CacheData.GroupList = CoolQApiExtend.GetGroupList(coolQApi);
                    CacheData.GroupList = new List <www_52bang_site_enjoy.MyModel.GroupInfo>();

                    /*
                     * CacheData.GroupList = new List<www_52bang_site_enjoy.MyModel.GroupInfo>();
                     * IEnumerable<Newbe.CQP.Framework.Extensions.GroupInfo> list = ExtrasCoolApiExtensions.GetGroupList(coolQApi);
                     * foreach (Newbe.CQP.Framework.Extensions.GroupInfo obj in list)
                     * {
                     *  CacheData.GroupList.Add(new www_52bang_site_enjoy.MyModel.GroupInfo(obj.GroupName,obj.GroupNumber,obj.OwnerNumber));
                     * }
                     */
                }
            }catch (Exception e)
            {
                MyLogUtil.ErrToLog("初始化出现异常,原因:" + e);
            }
        }
        private void btnLogin_Click(object sender, EventArgs e)
        {
            // 用户登录(UserLogin) url
            var url = "http://w.eydata.net/839c03e916a2a8e5"; //  这里改成自己的地址

            IDictionary <string, string> parameters = new Dictionary <string, string>();

            try
            {
                var code   = site.yinliu.OperateIniFile.ReadIniData("root", "code", "", "config.ini");
                var upName = site.yinliu.OperateIniFile.ReadIniData("root", "upName", "", "config.ini");
                if (code.Length > 0 && upName.Length > 0)
                {
                    //  退出登录(LogOut) url
                    var logOutUrl = "http://w.eydata.net/61b3173a01089775"; //  这里改成自己的地址

                    //  这里改成自己的参数名称
                    parameters.Add("StatusCode", code);
                    parameters.Add("UserName", upName);


                    WebPost.ApiPost(logOutUrl, parameters);

                    parameters.Clear();
                }

                //  这里改成自己的参数名称
                parameters.Add("UserName", txtLoginUserName.Text.Trim());
                parameters.Add("UserPwd", txtLoginUserPwd.Text);
                parameters.Add("Version", "1.1");
                parameters.Add("Mac", "");



                var ret = WebPost.ApiPost(url, parameters);

                if (ret.Length == 32)
                {
                    site.yinliu.OperateIniFile.WriteIniData("root", "code", ret, "config.ini");
                    site.yinliu.OperateIniFile.WriteIniData("root", "upName", txtLoginUserName.Text.Trim(), "config.ini");
                    if (ckbRememberMe.Checked)
                    {
                        site.yinliu.OperateIniFile.WriteIniData("root", "name", txtLoginUserName.Text, "config.ini");
                        site.yinliu.OperateIniFile.WriteIniData("root", "pwd", txtLoginUserPwd.Text, "config.ini");
                    }
                    else
                    {
                        site.yinliu.OperateIniFile.WriteIniData("root", "name", "", "config.ini");
                        site.yinliu.OperateIniFile.WriteIniData("root", "pwd", "", "config.ini");
                    }

                    //FrmMain frm = new FrmMain(ret,txtLoginUserName.Text.Trim());
                    this.Hide();
                    //frm.Show();
                    myPlugin.InitMainform(ret, txtLoginUserName.Text.Trim());
                }
                else
                {
                    String errInfo = YiYouCode.getValue(ret);
                    if (string.IsNullOrWhiteSpace(errInfo))
                    {
                        MessageBox.Show("登录失败,错误代码: " + ret);
                    }
                    else
                    {
                        MessageBox.Show(errInfo);
                    }
                }
            }
            catch (Exception e18)
            {
                MyLogUtil.ErrToLog("异常原因," + e18);
                MessageBox.Show("网络连接失败!");
            }
        }