コード例 #1
0
ファイル: ProxyForm.cs プロジェクト: avalondrey/PTC-Creator
 private void resetToolStripMenuItem_Click(object sender, EventArgs e)
 {
     foreach (DataGridViewRow row in ProxyDataGrid.SelectedRows)
     {
         Proxy p = row.DataBoundItem as Proxy;
         p.fail_count  = 0;
         p.creat_count = 0;
     }
     ProxyDataGrid.Refresh();
 }
コード例 #2
0
ファイル: ProxyForm.cs プロジェクト: avalondrey/PTC-Creator
 private void addMultipleToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (openFileDialog.ShowDialog() == DialogResult.OK)
     {
         if (!openFileDialog.CheckFileExists)
         {
             MessageBox.Show("File doesn't exist");
             return;
         }
         Regex         proxyAuth      = new Regex(@"\d+.\d+.\d+.\d+:\d+:.+:.+");
         Regex         proxy          = new Regex(@"\d+.\d+.\d+.\d+:\d+");
         int           previous_count = GlobalSettings.proxyList.Count; //Use to show how many unique proxies been added to queue
         List <string> proxy_list     = File.ReadAllLines(openFileDialog.FileName).ToList();
         proxy_list.ForEach(_ =>
         {
             Match m = proxyAuth.Match(_);
             if (m.Success)
             {
                 string[] values = m.Value.Split(':');
                 if (GlobalSettings.proxyList.FirstOrDefault(i => i.proxy == (values[0] + ":" + values[1])) == null)
                 {
                     GlobalSettings.proxyList.Add(new Proxy(values[0] + ":" + values[1], values[2], values[3]));
                 }
             }
             else
             {
                 m = proxy.Match(_);
                 if (m.Success && GlobalSettings.proxyList.FirstOrDefault(i => i.proxy == m.Value) == null)
                 {
                     GlobalSettings.proxyList.Add(new Proxy(m.Value));
                 }
             }
         });
         MessageBox.Show(GlobalSettings.proxyList.Count - previous_count + " unique proxies added to proxy list");
         ProxyDataGrid.Refresh();
     }
 }
コード例 #3
0
ファイル: ProxyForm.cs プロジェクト: avalondrey/PTC-Creator
 private void selectAllToolStripeMenuItem_Click(object sender, EventArgs e)
 {
     ProxyDataGrid.SelectAll();
     ProxyDataGrid.Refresh();
 }