Ejemplo n.º 1
0
    //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);
        }
    }
Ejemplo n.º 2
0
    //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;
        }
    }