示例#1
0
        private void Ok_Click(object sender, HtmlElementEventArgs e)
        {
            string passWord = GetElementById("Password").GetAttribute("value").Trim();

            if (passWord.Length < 6)
            {
                GetElementById("Password").SetAttribute("value", "");
                return;
            }

            //校验密码
            if (Encrypt.AESEncrypt(passWord, GlobalAppData.EncryptKey) == GlobalAppData.GetInstance().EntryPwd)
            {
                StartActivity("管理主界面");
            }
            else
            {
                GetElementById("Password").SetAttribute("value", "");
            }
        }
示例#2
0
        private void Ok_Click(object sender, HtmlElementEventArgs e)
        {
            string oldPass        = GetElementById("oldPass").GetAttribute("value");
            string newPass        = GetElementById("newPass").GetAttribute("value");
            string newPassConfirm = GetElementById("newPassConfirm").GetAttribute("value");

            if (Encrypt.AESEncrypt(oldPass, GlobalAppData.EncryptKey) != GlobalAppData.GetInstance().EntryPwd)
            {
                GetElementById("info").InnerText = "¾ÉÃÜÂëÊäÈë´íÎó£¡";
                GetElementById("oldPass").SetAttribute("value", "");
                GetElementById("newPass").SetAttribute("value", "");
                GetElementById("newPassConfirm").SetAttribute("value", "");
                return;
            }
            if (newPass.Length != 6)
            {
                GetElementById("info").InnerText = "ÐÂÃÜÂ볤¶È´íÎó£¡";
                GetElementById("oldPass").SetAttribute("value", "");
                GetElementById("newPass").SetAttribute("value", "");
                GetElementById("newPassConfirm").SetAttribute("value", "");
                return;
            }
            if (newPass != newPassConfirm)
            {
                GetElementById("info").InnerText = "ÐÂÃÜÂëÊäÈë²»Ò»Ö£¡";
                GetElementById("oldPass").SetAttribute("value", "");
                GetElementById("newPass").SetAttribute("value", "");
                GetElementById("newPassConfirm").SetAttribute("value", "");
                return;
            }
            GlobalAppData.GetInstance().EntryPwd = Encrypt.AESEncrypt(newPass, GlobalAppData.EncryptKey);
            GetElementById("info").InnerText = "ÃÜÂëÐ޸ijɹ¦£¡";
            GetElementById("oldPass").SetAttribute("value", "");
            GetElementById("newPass").SetAttribute("value", "");
            GetElementById("newPassConfirm").SetAttribute("value", "");
        }