コード例 #1
0
        static void SetSavePasswordState(SavePassword container, string strText)
        {
            string strState = "";

            if (IsType(strText, container, out strState) == false)
            {
                return;
            }

            TextBox textbox = container.PasswordTextBox;

            if (string.IsNullOrEmpty(strState) == false)
            {
                Hashtable table = StringUtil.ParseParameters(strState, ',', '=', "url");

                string strPassword = (string)table["password"];
                string strSave     = (string)table["save"];

                bool bSave = DomUtil.IsBooleanTrue(strSave);
                container.SaveOrNotCheckBox.Checked = bSave;

                if (bSave == true && string.IsNullOrEmpty(strPassword) == false)
                {
                    container.PasswordTextBox.Text = DecryptPasssword(strPassword);
                }
            }
        }
コード例 #2
0
        static string GetSavePasswordState(SavePassword container)
        {
            Hashtable table = new Hashtable();

            if (container.SaveOrNotCheckBox.Checked == true)
            {
                table["password"] = EncryptPassword(container.PasswordTextBox.Text);
            }
            table["save"] = container.SaveOrNotCheckBox.Checked == true ? "true" : "false";

            return(container.GetType().ToString() + ":"
                   + StringUtil.BuildParameterString(table, ',', '=', "url"));
        }
コード例 #3
0
ファイル: GuiState.cs プロジェクト: paopaofeng/dp2
        static void SetSavePasswordState(SavePassword container, string strText)
        {
            string strState = "";
            if (IsType(strText, container, out strState) == false)
                return;

            TextBox textbox = container.PasswordTextBox;

            if (string.IsNullOrEmpty(strState) == false)
            {
                Hashtable table = StringUtil.ParseParameters(strState);

                string strPassword = (string)table["password"];
                string strSave = (string)table["save"];

                bool bSave = DomUtil.IsBooleanTrue(strSave);
                container.SaveOrNotCheckBox.Checked = bSave;

                if (bSave == true && string.IsNullOrEmpty(strPassword) == false)
                {
                    container.PasswordTextBox.Text = DecryptPasssword(strPassword);
                }
            }
        }
コード例 #4
0
ファイル: GuiState.cs プロジェクト: paopaofeng/dp2
        static string GetSavePasswordState(SavePassword container)
        {
            Hashtable table = new Hashtable();
            if (container.SaveOrNotCheckBox.Checked == true)
                table["password"] = EncryptPassword(container.PasswordTextBox.Text);
            table["save"] = container.SaveOrNotCheckBox.Checked == true ? "true" : "false";

            return container.GetType().ToString() + ":"
                + StringUtil.BuildParameterString(table);
        }