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); } } }
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")); }
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); } } }
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); }