private void BtnBrowseServer_Click(object sender, RoutedEventArgs e) { string url = TbUrl.Text.Trim(); if (string.IsNullOrEmpty(url)) { MessageBox.Show("Url为空,请输入正确的Url"); return; } List <EndpointDes> endpointDeses = _OpcClient.FindServer(url); LbServer.ItemsSource = endpointDeses; }
private void BtnBrowseServer_Click(object sender, RoutedEventArgs e) { try { string url = TbUrl.Text.Trim(); if (string.IsNullOrEmpty(url)) { MessageBox.Show("Url为空,请输入正确的Url"); return; } List <EndpointDes> endpointDeses = _OpcClient.FindServer(url); LbServer.ItemsSource = endpointDeses; } catch (Exception ee) { Console.WriteLine(ee.Message); //throw; } }