コード例 #1
0
 public SendReturnObject SendSms(string txt, string receiver, DateTime dt)
 {
     try
     {
         if (LogStringValue != null)
         {
             LogStringValue("متن پیام", txt);
         }
         if (LogStringValue != null)
         {
             LogStringValue("گیرنده", receiver);
         }
         var    op = new Opilo(_username, _password);
         string err;
         var    res = (op.httpsend(_sender, new[] { receiver }, txt, out err))[0];
         return(new SendReturnObject(string.Empty, SentStatus.Successful, -1));
     }
     catch (Exception ex)
     {
         if (LogInternalException != null)
         {
             LogInternalException("SendSms", ex);
         }
     }
     return(new SendReturnObject(string.Empty, SentStatus.Failed, -1));
 }
コード例 #2
0
 public double GetCurrentCredit()
 {
     try
     {
         var    op = new Opilo(_username, _password);
         string err;
         return(Convert.ToDouble(op.GetCredit(out err)) * 80);
     }
     catch (Exception ex)
     {
         if (LogInternalException != null)
         {
             LogInternalException("GetCurrentCredit", ex);
         }
     }
     return(0);
 }