Exemplo n.º 1
0
 private void simpleButton_start_Click(object sender, EventArgs e)
 {
     if (simpleButton_start.Text == "选择")
     {
         OpenFileDialog ofd = new OpenFileDialog();
         if (ofd.ShowDialog() == DialogResult.OK)
         {
             textEdit_dir.Text       = ofd.FileName;
             simpleButton_start.Text = "开始";
         }
     }
     else if (simpleButton_start.Text == "开始")
     {
         simpleButton_start.Enabled = false;
         PcapAnalysis   analysis = new PcapAnalysis(this);
         ThreadCallBack tcb      = new ThreadCallBack(analysis.initAnalysis);
         IAsyncResult   result   = tcb.BeginInvoke(new AsyncCallback(CallBackFun), null);
     }
 }
Exemplo n.º 2
0
        public void CallBackFun(IAsyncResult result)
        {
            ThreadCallBack tcb = (ThreadCallBack)((AsyncResult)result).AsyncDelegate;

            simpleButton_start.Enabled = true;
        }
Exemplo n.º 3
0
 public InfluxDBThreadTask(HttpInfluxDBClient influxDBClient, DBOptsType type, string database, string sql, ThreadCallBack threadCallBack)
 {
     this.influxDBClient = influxDBClient;
     this.type           = type;
     this.database       = database;
     this.sql            = sql;
     this.threadCallBack = threadCallBack;
 }