using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LYFZ.WinicSmsInterface { /// /// Http方式短信发送接口返回信息 /// public class HTTPSmsSendReturnInfo : LYFZ.StandardInterface.IHTTPSmsSendReturnInfo { public HTTPSmsSendReturnInfo(string returnInfoStr) { this.SourceString = returnInfoStr; if (!returnInfoStr.ToLower().Contains("/send:")) { this.SourceString = "-1/Send:0/Consumption:.0/Tmoney:0/sid:0/访问短信服务商服务器失败【HTTPSmsSendReturnInfo错误信息:" + returnInfoStr + "】"; } if (returnInfoStr != "") { string[] returnInfos = this.SourceString.Split('/'); try { if (!returnInfoStr.ToLower().Contains("/send:")) { this.ReturnStatus = returnInfoStr; } else { this.ReturnStatus = SendSmsResults.GetResults(returnInfos[0]); this.ReturnCode = returnInfos[0]; } } catch { this.ReturnStatus = this.SourceString; } try { this.SendCount = Convert.ToInt32(returnInfos[1].Split(':')[1]); } catch { this.ReturnStatus = this.SourceString; } try { this.Consumption = Convert.ToDecimal(returnInfos[2].Split(':')[1]); } catch { } try { this.Tmoney = Convert.ToDecimal(returnInfos[3].Split(':')[1]); } catch { } try { this.Sid = returnInfos[4]; } catch { } } } private string _SourceString = ""; /// /// 源字符串 /// public string SourceString { get { return _SourceString; } set { _SourceString = value; } } int _SendCount = 0; /// /// 发送条数 /// public int SendCount { get { return _SendCount; } set { _SendCount = value; } } decimal _Consumption=0m; /// /// 当次消费金额 /// public decimal Consumption { get { return _Consumption; } set { _Consumption = value; } } decimal _Tmoney = 0m; /// /// 总体余额 /// public decimal Tmoney { get { return _Tmoney; } set { _Tmoney = value; } } int _RemainingNumber = -1; /// /// 总体余额_剩余条数 /// public int RemainingNumber { get { return _RemainingNumber; } set { _RemainingNumber = value; } } string _Sid = ""; /// /// 短信编号 /// public string Sid { get { return _Sid; } set { _Sid = value; } } string _ReturnStatus = ""; /// /// 返回状态 状态码:代码说明 /// public string ReturnStatus { get { return _ReturnStatus; } set { _ReturnStatus = value; } } string returnCode = "-12"; /// /// 返回发送状态码 000 为发送成功,其它为失败 /// public string ReturnCode { get { return returnCode; } set { returnCode = value; } } decimal _Price; /// /// 单价 /// public decimal Price { get { try { this._Price = this._Consumption / _SendCount; } catch { this._Price = 0m; } return _Price; } } string _SendSuccessTel = ""; /// /// 发送成功的手机号 多个以“,”号分隔 /// public string SendSuccessTel { get { return _SendSuccessTel; } set { _SendSuccessTel = value; } } string _SendFaileTel = ""; /// /// 发送失败的手机号 多个以“,”号分隔 /// public string SendFaileTel { get { return _SendFaileTel; } set { _SendFaileTel = value; } } /// /// 短信接口服务商 /// public string SMSInterface { get { return "深圳吉信通"; } } } }