示例#1
0
 private void threadRun()
 {
     NetHelper.ChangeIP(2, msg => {
         if (!listBox1.IsHandleCreated)
         {
             return;
         }
         listBox1.BeginInvoke(new Pub.Class.Action(() => {
             if (listBox1.Items.Count > 10000)
             {
                 listBox1.Items.Clear();
             }
             listBox1.Items.Add(msg);
             listBox1.SelectedIndex = listBox1.Items.Count - 1;
         }));
     }, () => {
         this.BeginInvoke(new Pub.Class.Action(() => {
             btnConnect.Enabled = true;
         }));
     });
 }