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; }
private void btnReset_Click(object sender, EventArgs e) { var thread = new Thread(() => { httpInfluxDBClient = new HttpInfluxDBClient(tbxBaseUrl.Text, tbxUsername.Text, tbxPassword.Text); }); thread.IsBackground = true; thread.Start(); }
private void FormHttpTest_Load(object sender, EventArgs e) { // 允许跨线程调用 Control.CheckForIllegalCrossThreadCalls = false; var thread = new Thread(() => { httpInfluxDBClient = new HttpInfluxDBClient(tbxBaseUrl.Text, tbxUsername.Text, tbxPassword.Text); }); thread.IsBackground = true; thread.Start(); // 开启工作队列线程 InfluxDBThreadWorkQueue.Start(); }