コード例 #1
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            capture          capt   = new capture();
            BackgroundWorker worker = sender as BackgroundWorker;

            while (true)
            {
                if (worker.CancellationPending == true)
                {
                    e.Cancel = true;
                    break;
                }
                string        s     = "";
                MethodInvoker combo = new MethodInvoker(() =>
                {
                    s = comboBox1.Text;
                });
                comboBox1.Invoke(combo);

                capt.ipCapt(backgroundWorker1, checkBox2, s, button1);
            }
        }
コード例 #2
0
ファイル: Sniffer.cs プロジェクト: KataKonst/Packet-Analyzer
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            capture capt = new capture();
            BackgroundWorker worker = sender as BackgroundWorker;
            while (true)
            {
                if (worker.CancellationPending == true)
                {
                    e.Cancel = true;
                    break;

                }
                 string s="";
                 MethodInvoker combo = new MethodInvoker(() =>
            {
            s = comboBox1.Text;
            });
                 comboBox1.Invoke(combo);

                capt.ipCapt(backgroundWorker1,checkBox2,s,button1);
            }
        }