using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LYFZ.WinicSmsInterface
{
///
/// WebService短信接口
///
public class WebServiceSmsInterface
{
public WebServiceSmsInterface() { }
///
/// 用户帐号查询
///
///
///
///
public static SmsUserInfo GetSmsUserInfo(string uid,string pwd)
{
winic.SmsService.Service1 ws = new winic.SmsService.Service1();
string infoStr= ws.GetUserInfo(uid,pwd);
return new SmsUserInfo(infoStr);
}
///
/// 发送短信
///
/// 帐号
/// 密码
/// 目标手机号,多个用“,”号分隔
/// 内容
/// 定时发送时间,忽略时为即时发送
///
public static string SendSmsMessages(string uid, string pwd, string tos, string msg, string otime = "")
{
winic.SmsService.Service1 ws = new winic.SmsService.Service1();
string infoStr = ws.SendMessages(uid, pwd, tos, msg, otime);
return infoStr;
}
///
/// 查询短信发送结果
///
/// 帐号
/// 密码
/// 发送成功后的短信编号
/// 查询日期,为空时为当天日期
///
public static SmsWebServiceSendReturnInfo GetMessageRecord(string uid, string pwd, string num, string isday = "")
{
winic.SmsService.Service1 ws = new winic.SmsService.Service1();
if (isday == "")
{
isday = DateTime.Now.ToString("yyyyMMdd");
}
string infoStr = ws.GetMessageRecord(uid, pwd, num, "", "", isday);
return new SmsWebServiceSendReturnInfo(infoStr);
}
///
/// 查询指定日期短信发送记录结果
///
/// 帐号
/// 密码
/// 查询日期,为空时为当天日期
///
public static SendRecordQueryList GetMessageRecord(string uid, string pwd, string isday = "")
{
winic.SmsService.Service1 ws = new winic.SmsService.Service1();
if (isday == "")
{
isday = DateTime.Now.ToString("yyyyMMdd");
}
string infoStr = ws.GetMessageRecord(uid, pwd, "", "", "", isday);
return new SendRecordQueryList(infoStr);
}
}
}