static public bool testConnect(string AddressServer) { try { WebReference.WebSDataBrCode BrServer = new WebReference.WebSDataBrCode(); BrServer.SoapVersion = System.Web.Services.Protocols.SoapProtocolVersion.Soap12; BrServer.BrHeaderValue = CBrHeader.GetHeader(); BrServer.Credentials = new NetworkCredential(CBrHeader.Login, CBrHeader.Password); BrServer.Url = AddressServer; string message = "Terminal OnLine; BufferCount: " + CountBuffer; bool result = BrServer.Test_Connect(message); return(result); } catch (System.Net.WebException) { return(false); } catch (System.Net.Sockets.SocketException) {//На случай если во время выполнения сломается связть return(false); } }