private void InsertProxy(ProxyIP acc) { ListViewItem lvi = new ListViewItem(); lvi.Text = (listView3.Items.Count + 1).ToString(); lvi.Tag = acc.id; // lvi.SubItems.Add(accs[0]); lvi.SubItems.Add(acc.ip); lvi.SubItems.Add(acc.port); lvi.SubItems.Add(acc.user); lvi.SubItems.Add(acc.pass); this.listView3.Items.Add(lvi); }
public ProxyIP GetChuShiDaiLiGLModel() { if (IsInt(f.label27.Text)) { ProxyIP city = new ProxyIP(); city.id = f.label27.Text; city.ip = f.textBox22.Text; city.port = f.textBox23.Text; city.user = f.textBox24.Text; city.pass = f.textBox25.Text; return city; } return null; }
private void ImportProxy(string file) { if (!File.Exists(file)) return; using (StreamReader reader = new StreamReader(file)) { // StreamWriter writer = new StreamWriter(Path.Combine(path, "account.txt"), true); string str2 = reader.ReadLine(); while ((str2 != null) && (str2 != "")) { string[] accs = str2.Split(':'); if (accs.Length == 2) { ProxyIP ac = new ProxyIP(); ac.ip = accs[0]; ac.port = accs[1]; if (Query<ProxyIP>.Count("ip='" + ac.ip + "'") == 0) { Query<ProxyIP>.InsertObj(ac); InsertProxy(ac); } // writer.WriteLine(str2); } str2 = reader.ReadLine(); } // writer.Close(); } }