コード例 #1
0
ファイル: QXTSMSConnector.cs プロジェクト: chinaq/micro-emall
        private SendResult GetResult(string resposeText)
        {
            SendResult result = new SendResult();
            if (!string.IsNullOrWhiteSpace(resposeText))
            {
                if (resposeText.IndexOf("&") == -1)
                {
                    result.StatusCode = int.Parse(resposeText);
                    result.Value = "发送成功";
                }
                else
                {
                    result.Value = resposeText.Split('&')[1];
                    switch (result.Value)
                    {
                        case "您的余额不足以支持此次发送,请您充值":
                            result.StatusCode = 1;
                            result.Value = "余额不足";
                            break;
                        default:
                            result.StatusCode = 3;
                            result.Value = "发送失败";
                            break;
                    }
                }
            }

            return result;
        }
コード例 #2
0
ファイル: ZTSMSConnector.cs プロジェクト: chinaq/micro-emall
        private SendResult GetResult(string resposeText)
        {
            SendResult result = new SendResult();
            if (!string.IsNullOrWhiteSpace(resposeText))
            {
                if (resposeText.IndexOf(",") != -1)
                    result.StatusCode = int.Parse(resposeText.Split(',')[0]);

                switch (result.StatusCode)
                {
                    case -1:
                        result.Value = "用户名或者密码不正确";
                        break;
                    case 1:
                        result.Value = "发送成功";
                        break;
                    case 0:
                        result.Value = "发送失败";
                        break;
                    case 2:
                        result.Value = "余额不足";
                        break;
                    case 3:
                        result.Value = "扣费失败";
                        break;
                    case 5:
                        result.Value = "短信定时成功";
                        break;
                    case 6:
                        result.Value = "有效号码为空";
                        break;
                    case 7:
                        result.Value = "短信内容为空";
                        break;
                    case 8:
                        result.Value = "无签名";
                        break;
                    case 9:
                        result.Value = "没有Url提交权限";
                        break;
                    case 10:
                        result.Value = "发送号码过多";
                        break;
                    case 11:
                        result.Value = "产品ID异常";
                        break;
                    case 12:
                        result.Value = "参数异常";
                        break;
                    case 13:
                        result.Value = "重复提交";
                        break;
                    case 14:
                        result.Value = "禁止提交";
                        break;
                    case 15:
                        result.Value = "Ip验证失败";
                        break;
                    case 19:
                        result.Value = "短信内容过长";
                        break;
                    case 20:
                        result.Value = "定时时间格式不正确";
                        break;
                    default:
                        result.Value = "未知错误";
                        break;
                }
            }

            return result;
        }
コード例 #3
0
        private SendResult GetResult(string resposeText)
        {
            SendResult result = new SendResult();

            if (!string.IsNullOrWhiteSpace(resposeText))
            {
                if (resposeText.IndexOf(",") != -1)
                {
                    result.StatusCode = int.Parse(resposeText.Split(',')[0]);
                }

                switch (result.StatusCode)
                {
                case -1:
                    result.Value = "用户名或者密码不正确";
                    break;

                case 1:
                    result.Value = "发送成功";
                    break;

                case 0:
                    result.Value = "发送失败";
                    break;

                case 2:
                    result.Value = "余额不足";
                    break;

                case 3:
                    result.Value = "扣费失败";
                    break;

                case 5:
                    result.Value = "短信定时成功";
                    break;

                case 6:
                    result.Value = "有效号码为空";
                    break;

                case 7:
                    result.Value = "短信内容为空";
                    break;

                case 8:
                    result.Value = "无签名";
                    break;

                case 9:
                    result.Value = "没有Url提交权限";
                    break;

                case 10:
                    result.Value = "发送号码过多";
                    break;

                case 11:
                    result.Value = "产品ID异常";
                    break;

                case 12:
                    result.Value = "参数异常";
                    break;

                case 13:
                    result.Value = "重复提交";
                    break;

                case 14:
                    result.Value = "禁止提交";
                    break;

                case 15:
                    result.Value = "Ip验证失败";
                    break;

                case 19:
                    result.Value = "短信内容过长";
                    break;

                case 20:
                    result.Value = "定时时间格式不正确";
                    break;

                default:
                    result.Value = "未知错误";
                    break;
                }
            }

            return(result);
        }