private void ButtonNetConnect_Click_1(object sender, EventArgs e) { if (listView1.SelectedIndices.Count <= 0 || SelectedNetDeviceIp == String.Empty) { MessageBox.Show("Please select One Of The Device To Connect"); return; } if (isSearchingDevice == true) { MessageBox.Show("Please Stop Searching First"); return; } string result = "select Ip: " + SelectedNetDeviceIp + "select SN: " + SN; Console.WriteLine(result); netManager.Connect(SelectedNetDeviceIp, 2010); if (netManager.IsConnected()) { MessageBox.Show("连接成功" + result); } }