Esempio n. 1
0
        private void Btn_update_Click(object sender, EventArgs e)
        {
            string nmima  = text_nmima.Text;
            string cnmima = text_ncmima.Text;
            string lable  = Encrypt.StringToBase64string(text_lable.Text);;

            if (nmima.Equals(cnmima) && nmima != "")
            {
                string keypath = XMLDealTool.getKeyPath() + "\\" + this.record.title + ".png";
                string nkey    = KeyConvert.CreateKey(keypath);
                nmima = Encrypt.AESEncrypt(nmima, nkey);
                nmima = Encrypt.StringToBase64string(nmima);
                string url    = XMLDealTool.getUrlPath() + "cloudkey/update_pass.php";
                string data   = "username="******"&password="******"&key=" + nkey + "&num=" + this.record.num + "&mima=" + nmima + "&lable=" + lable;
                string result = HttpGet.HttpGet_test(url, data);
                if (result.IndexOf("ok") != -1)
                {
                    MessageBox.Show("修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    text_nmima.ResetText();
                    text_ncmima.ResetText();
                    text_lable.ResetText();
                }
                else
                {
                    MessageBox.Show("修改失败,请重新登录后再进行修改!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            else
            {
                MessageBox.Show("请检查输入的新密码!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Esempio n. 2
0
        private void skinButton1_Click(object sender, EventArgs e)
        {
            string title    = text_title.Text;
            string zhanghao = text_zhanghao.Text;
            string mima     = text_mima.Text;
            string conmima  = text_conmima.Text;
            string lable    = text_lable.Text;



            if (mima.Equals(conmima) && title != "" && zhanghao != "" && mima != "")
            {
                string keypath = XMLDealTool.getKeyPath() + "\\" + title + ".png";
                string key     = KeyConvert.CreateKey(keypath);
                mima     = Encrypt.AESEncrypt(mima, key);
                mima     = Encrypt.StringToBase64string(mima);
                title    = Encrypt.StringToBase64string(title);
                zhanghao = Encrypt.StringToBase64string(zhanghao);
                lable    = Encrypt.StringToBase64string(lable);

                string url  = XMLDealTool.getUrlPath() + "cloudkey/addpass.php";
                string data = "username="******"&password="******"&title=" + title + "&zhanghao=" + zhanghao;
                data = data + "&key=" + key + "&mima=" + mima + "&lable=" + lable;
                string result = HttpGet.HttpGet_test(url, data);

                if (result.IndexOf("ok") != -1)
                {
                    MessageBox.Show("添加成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    text_title.ResetText();
                    text_zhanghao.ResetText();
                    text_mima.ResetText();
                    text_conmima.ResetText();
                    text_lable.ResetText();
                }
                else
                {
                    //添加失败删除key图片
                    File.Delete(keypath);
                    MessageBox.Show("添加失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("请输入完整的账号信息!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }