1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace LYFZ.WeinaSmsInterface
- {
- /// <summary>
- /// 反代码说明
- /// </summary>
- public class SendSmsResults
- {
- /// <summary>
- /// 短信发送状态
- /// </summary>
- public enum SendStatus
- {
- 发送成功,
- 发送失败,
- 等待发送,
- 忽略发送,
- 手动重发中
- }
- public SendSmsResults()
- { }
- public static string GetReturnValue(string name, string sourceString)
- {
- string[] userInfos = sourceString.Split('&');
- string value = "-1";
- try
- {
- for (int i = 0; i < userInfos.Length; i++)
- {
- if (userInfos[i].Split('=')[0].Trim().ToLower() == name.Trim().ToLower())
- {
- value = userInfos[i].Split('=')[1];
- break;
- }
- }
- }
- catch { }
- return value;
- }
- /// <summary>
- /// 根据返回代码 获取错误信息
- /// </summary>
- /// <param name="code"></param>
- /// <returns></returns>
- public static string GetResults(string code)
- {
- string resultStr = "";
- switch (code)
- {
- case "0": resultStr = "成功"; break;
- case "6001": resultStr = "该企业用户无效"; break;
- case "6002": resultStr = "该企业用户名无效"; break;//
- case "6008": resultStr = "无效的手机号码"; break;
- case "6009": resultStr = "手机号码是黑名单"; break;
- case "6010": resultStr = "企业用户验证失败"; break;//
- case "6011": resultStr = "短信内容超过了最大长度限制"; break;
- case "6012": resultStr = "该企业用户设置了ip限制"; break;
- case "6013": resultStr = "该企业用户余额不足"; break;//
- case "6014": resultStr = "发送短信内容不能为空"; break;
- case "6015": resultStr = "发送内容中含非法字符"; break;
- case "6019": resultStr = "此接口已经停止使用"; break;
- case "6021": resultStr = "扩展号码未备案"; break;
- case "6023": resultStr = "发送手机号码超过太长,已超过70个号码"; break;
- case "6024": resultStr = "定制时间不正确"; break;
- case "6025": resultStr = "扩展号码太长"; break;
- case "6030": resultStr = "此帐号是营销版帐号,无法使用"; break;
- case "6080": resultStr = "提交异常,请联系服务商解决"; break;
- case "6085": resultStr = "内容为空"; break;
- case "-1": resultStr = "服务器网络错误,无法找到接口服务器"; break;
- default: resultStr = "未知错误"; break;
- }
- return resultStr;
- }
- }
- }
|