Example #1
0
 public async Task <System.Single> getCreditAsync(string userName, string password, string domain, bool useProxy, string proxyAddress, string proxyUsername, string proxyPassword)
 {
     MagfaWebReference.SoapSmsQueuableImplementationService sq = new MagfaWebReference.SoapSmsQueuableImplementationService();
     if (useProxy)
     {
         WebProxy proxy;
         proxy             = new WebProxy(proxyAddress);
         proxy.Credentials = new NetworkCredential(proxyUsername, proxyPassword);
         sq.Proxy          = proxy;
     }
     sq.Credentials     = new System.Net.NetworkCredential(userName, password);
     sq.PreAuthenticate = true;
     return(await Task.Run(() => sq.getCredit(domain)));
 }