//Private Method CheckConnection private bool CheckConnection() { try { SmsClient.ServerAddress = ServerAddress; SmsClient.Port = Convert.ToInt32(ServerPort); SmsClient.HttpProxy.ProxyMode = HttpProxyMode.AutoDetect; //SmsClient.HttpProxy.Host = ProxyAddress; //SmsClient.HttpProxy.Port = Convert.ToInt32(ProxyPort); SmsClient sms = new SmsClient(Username, Password); if (sms.TestConnection()) { return(true); } else { return(false); } } catch (Exception ex) { return(false); } }
//Private Method CheckConnection private bool CheckConnection() { try { SmsClient.ServerAddress = ServerAddress; SmsClient.Port = Convert.ToInt32(ServerPort); SmsClient.HttpProxy.ProxyMode = HttpProxyMode.AutoDetect; //SmsClient.HttpProxy.Host = ProxyAddress; //SmsClient.HttpProxy.Port = Convert.ToInt32(ProxyPort); SmsClient sms = new SmsClient(Username, Password); if (sms.TestConnection()) { return true; } else { return false; } } catch (Exception ex) { return false; } }