/// <summary> /// 存储一条数据 /// </summary> private void saveOneData() { A_PS temp = new A_PS() { ACCT = comboAcct.Text, PASS = textPassword.Text }; XmlHelper.AddOneData(textURL.Text, temp.ACCT, temp.PASS); if (textURL.Text.Equals(LastLoginIP)) { if (!FtpData.Contains(temp)) { comboAcct.Items.Add(temp.ACCT); FtpData.Add(temp); } } else { XmlHelper.ReadAllDatas(textURL.Text, ref FtpData); FillCombAcc(); LastSelectedIndex = FtpData.Count - 1; LastLoginIP = textURL.Text; XmlHelper.setLastChoice(LastLoginIP, LastSelectedIndex); //填充数据 //setAcctInfo(); } }
/// <summary> /// 重写了Equals方法 /// </summary> /// <param name="obj"></param> /// <returns></returns> public override bool Equals(object obj) { if (obj == null) { return(false); } A_PS temp = (A_PS)obj; return(this.ACCT.Equals(temp.ACCT)); }