Exemple #1
0
        /// <summary>
        ///     注册序列号
        /// </summary>
        /// <returns></returns>
        public static bool RegistEx()
        {
            string SerialNo = BLL.SysManage.ConfigSystem.GetValueByCache("Emay_SMS_SerialNo");
            string Key      = BLL.SysManage.ConfigSystem.GetValueByCache("Emay_SMS_Key");
            string Pwd      = BLL.SysManage.ConfigSystem.GetValueByCache("Emay_SMS_Pwd");

            if (String.IsNullOrWhiteSpace(SerialNo) || String.IsNullOrWhiteSpace(Key))
            {
                LogHelp.AddErrorLog("亿美短信接口缺少企业序列号或者自定义关键字Key", "亿美短信接口调用失败", HttpContext.Current.Request);
                return(false);
            }
            SMSService.SDKClient sdkClient = new SDKClientClient();
            registExRequest      request   = new registExRequest(SerialNo, Key, Pwd);
            registExResponse     response  = sdkClient.registEx(request);

            if (response.@return == 0)
            {
                return(true);
            }
            string msg = RegistExException(response.@return);

            LogHelp.AddErrorLog("亿美短信注册序列号出现异常,【" + msg + "】", "亿美短信接口调用失败", HttpContext.Current.Request);
            return(false);
        }
Exemple #2
0
 public static bool RegistEx()
 {
     string valueByCache = ConfigSystem.GetValueByCache("Emay_SMS_SerialNo");
     string str2 = ConfigSystem.GetValueByCache("Emay_SMS_Key");
     string str3 = ConfigSystem.GetValueByCache("Emay_SMS_Pwd");
     if (string.IsNullOrWhiteSpace(valueByCache) || string.IsNullOrWhiteSpace(str2))
     {
         LogHelp.AddErrorLog("亿美短信接口缺少企业序列号或者自定义关键字Key", "亿美短信接口调用失败", HttpContext.Current.Request);
         return false;
     }
     SDKClient client = new SDKClientClient();
     registExRequest request = new registExRequest(valueByCache, str2, str3);
     registExResponse response = client.registEx(request);
     if (response.@return == 0)
     {
         return true;
     }
     LogHelp.AddErrorLog("亿美短信注册序列号出现异常,【" + RegistExException(response.@return) + "】", "亿美短信接口调用失败", HttpContext.Current.Request);
     return false;
 }
Exemple #3
0
 /// 通道开通注册
 /// </summary>
 /// <param name="serialpass"></param>
 /// <returns></returns>
 public int registEx(string serialpass)
 {
     SmsToEme.SDKClientClient client = new SDKClientClient();
     var result= client.registEx(SerialNo, SoftwareKey, serialpass);
     return result;
 }