Example #1
0
        private void buttonUpdatePassword_Click(object sender, EventArgs e)
        {
            if (textBoxAccount.Text == "")
            {
                MessageBox.Show("账号不能为空", "提示");
                return;
            }
            if (textBoxNewPassword.Text == "")
            {
                MessageBox.Show("新密码不能为空", "提示");
                return;
            }
            if (textBoxSecurityCode.Text == "")
            {
                MessageBox.Show("安全码不能为空", "提示");
                return;
            }

            try
            {
                string msg = VerifyApiLaunch.updatePassword
                             (
                    textBoxAccount.Text,
                    textBoxNewPassword.Text,
                    VerifyOverAll.softId,
                    textBoxSecurityCode.Text
                             );
                MessageBox.Show(msg, "修改通知");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "软件错误");
            }
        }
Example #2
0
        private void buttonRedeem_Click(object sender, EventArgs e)
        {
            if (textBoxAccount.Text == "")
            {
                MessageBox.Show("账号不能为空", "提示");
                return;
            }
            if (textBoxPassword.Text == "")
            {
                MessageBox.Show("密码不能为空", "提示");
                return;
            }
            if (textBoxCardNumber.Text == "")
            {
                MessageBox.Show("卡密不能为空", "提示");
                return;
            }

            try
            {
                string msg = VerifyApiLaunch.bindingCard
                             (
                    textBoxAccount.Text,
                    textBoxPassword.Text,
                    textBoxCardNumber.Text,
                    VerifyOverAll.softId,
                    VerifyOverAll.rsaPublicKey
                             );
                MessageBox.Show(msg, "充值结果");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "软件错误");
            }
        }
Example #3
0
        /// <summary>
        /// 点击注册按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonRegister_Click(object sender, EventArgs e)
        {
            if (textBoxAccount.Text == "")
            {
                MessageBox.Show("账号不能为空", "提示");
                return;
            }
            if (textBoxPassword.Text == "")
            {
                MessageBox.Show("密码不能为空", "提示");
                return;
            }
            if (textBoxQqNumber.Text == "")
            {
                MessageBox.Show("QQ号不能为空", "提示");
                return;
            }
            if (textBoxName.Text == "")
            {
                MessageBox.Show("姓名不能为空", "提示");
                return;
            }
            if (textBoxSecruityCode.Text == "")
            {
                MessageBox.Show("安全码不能为空", "提示");
                return;
            }
            if (textBoxVc.Text == "")
            {
                MessageBox.Show("验证码不能为空", "提示");
                return;
            }

            try
            {
                string msg = VerifyApiLaunch.register
                             (
                    textBoxAccount.Text,
                    textBoxPassword.Text,
                    textBoxQqNumber.Text,
                    VerifyOverAll.softId,
                    textBoxName.Text,
                    textBoxSecruityCode.Text,
                    VerifyOverAll.rsaPublicKey,
                    textBoxVc.Text
                             );
                MessageBox.Show(msg, "注册结果");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "程序错误");
            }
        }
Example #4
0
 /// <summary>
 /// 获取验证码
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void buttonGetVc_Click(object sender, EventArgs e)
 {
     new Thread(new ThreadStart(() =>
     {
         try
         {
             pictureBoxVc.Image = VerifyApiLaunch.getVerificationCode(VerifyOverAll.rsaPublicKey);
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "程序错误");
         }
     })).Start();
 }
Example #5
0
        public VerifyForm(InitVerify initVerify)
        {
            InitializeComponent();

            VerifyOverAll.site    = initVerify.Site;
            VerifyOverAll.softId  = initVerify.SoftId;
            VerifyOverAll.runForm = initVerify.RunForm;

            LoadingHelper.ShowLoading("正在初始化软件.....请耐心稍等....", this, o =>
            {
                try
                {
                    VerifyApiLaunch.site = VerifyOverAll.site;

                    VerifyOverAll.rsaPublicKey = VerifyApiLaunch.getRsaPublicKey();

                    VerifyApiLaunch.getSoftDesc
                    (
                        VerifyOverAll.softId,
                        out VerifyOverAll.notice,
                        out VerifyOverAll.name,
                        out VerifyOverAll.dosingStrategy,
                        out VerifyOverAll.registerStatus,
                        out VerifyOverAll.registeCloseMsg,
                        out VerifyOverAll.serviceStatus,
                        out VerifyOverAll.serviceCloseMsg,
                        out VerifyOverAll.changeStrategy
                    );

                    if (VerifyOverAll.serviceStatus == 2)
                    {
                        MessageBox.Show(VerifyOverAll.serviceCloseMsg.Replace("\n", "\r\n"), "软件开放使用提示");
                        System.Environment.Exit(0);
                    }
                    else if (VerifyOverAll.serviceStatus == 0)
                    {
                        toolStripStatusLabel2.Text = "软件类型:收费软件";
                    }
                    else if (VerifyOverAll.serviceStatus == 1)
                    {
                        toolStripStatusLabel2.Text = "软件类型:免费软件";
                    }
                    if (VerifyOverAll.serviceStatus == 0)
                    {
                        linkLabelOpenRecharge.Visible = true;
                    }
                    if (VerifyOverAll.changeStrategy == 0)
                    {
                        linkLabelOpenExchange.Visible = true;
                    }

                    this.Text          = VerifyOverAll.name;
                    textBoxNotice.Text = VerifyOverAll.notice.Replace("\n", "\r\n");
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message, "未知错误");
                    System.Environment.Exit(0);
                }
            });

            // 初始化配置
            try
            {
                checkBoxRemember.Checked = Convert.ToBoolean(fileIniConfig.ReadFile(INI_FILE)["input"]["remember"]);
                if (checkBoxRemember.Checked == true)
                {
                    textBoxAccount.Text  = fileIniConfig.ReadFile(INI_FILE)["input"]["account"];
                    textBoxPassword.Text = fileIniConfig.ReadFile(INI_FILE)["input"]["password"];
                }
            }
            catch (Exception ex)
            {
                FileOp.WriteFile(INI_FILE);
            }
        }
Example #6
0
        private void buttonLogin_Click(object sender, EventArgs e)
        {
            if (textBoxAccount.Text == "")
            {
                MessageBox.Show("用户名不能为空", "提示");
                return;
            }
            if (textBoxPassword.Text == "")
            {
                MessageBox.Show("密码不能为空", "提示");
                return;
            }

            try
            {
                if (checkBoxRemember.Checked == true)
                {
                    try
                    {
                        IniData data = fileIniConfig.ReadFile(INI_FILE);
                        data["input"]["account"]  = textBoxAccount.Text;
                        data["input"]["password"] = textBoxPassword.Text;
                        fileIniConfig.WriteFile(INI_FILE, data);
                    }
                    catch (Exception ex)
                    {
                    }
                }

                string msg = VerifyApiLaunch.login
                             (
                    textBoxAccount.Text,
                    textBoxPassword.Text,
                    VerifyOverAll.softId,
                    VerifyOverAll.rsaPublicKey
                             );
                if (msg == "登陆成功")
                {
                    if (VerifyOverAll.serviceStatus == 0) // 收费
                    {
                        try
                        {
                            VerifyApiLaunch.getCardTimeLimit
                            (
                                textBoxAccount.Text,
                                textBoxPassword.Text,
                                VerifyOverAll.softId,
                                out string startDate,
                                out string endDate
                            );
                            string msgCard = "卡密开始使用时间:" + startDate + "\r\n" + "卡密到期时间:" + endDate;
                            MessageBox.Show(msgCard, "卡密时长");
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message, "软件错误");
                        }
                    }
                    // 载入窗口
                    VerifyOverAll.runForm.Show();

                    // 主窗口隐藏
                    this.Hide();
                }
                else
                {
                    MessageBox.Show(msg, "登陆结果");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "软件错误");
            }
        }