private async void btnStart_Click(object sender, EventArgs e) { CustomerJsonRead <ConfigureMessageModel> configureJson = new CustomerJsonRead <ConfigureMessageModel>(); var configure = configureJson.GetJsonClass(); if (configure == null) { MessageBox.Show("请先配置通讯信息"); return; } tcp = new TCPCommunication(configure.TCPS.TCPCameria.IP, PackageOk); tcp.Port = configure.TCPS.TCPCameria.Port; await tcp.ConnectAsync(); }
public async void ConnectDevice() { await tcpClient.ConnectAsync(); ScanTask.Start(); }