http://www.xingnanriji.com/
/// <summary>
/// 验证码
/// </summary>
/// <param name="tel">手机号</param>
/// <returns></returns>
public string yzm(string tel, ref Dictionary<string, object> ht)
{
string res = "";
#region
//SmsClient client = new SmsClient();
//string num = helpService.getYZM();
json数据返回
//Dictionary<string, object> ret = client.SendSMS(tel, "验证码:" + num, "1234", "");//123456788990000
//string code = ret["code"].ToString();
//if (code == Constants.SUCCESS_CODE)
//{
// res = "1";
// ht.Add("num", num);
//}
//else
//{
// res = string.Format("发送失败:失败编码{0},{1}", ret["code"], ret["message"]);
//}
#endregion
string num = helpService.getYZM();
string data = "account=yw5764290&pwd=123789&product=15&mobile=" + tel + "&message=你好你的验证码是" + num + "【签名】";
string bval = utility.HttpPost("http://dx.10659com.com:83/ApiService.asmx/Send", data);
if (bval.IndexOf("200,") > -1)
{
res = "1";
ht.Add("num", num);
}
else
{
string msg = "";
if (bval.IndexOf("-100") > -1)
{
msg = "账号或密码不合法";
}
else if (bval.IndexOf("-101") > -1)
{
msg = "关键词不合法";
}
else if (bval.IndexOf("-102") > -1)
{
msg = "产品不存在";
}
else if (bval.IndexOf("-103") > -1)
{
msg = "数据包过长";
}
else if (bval.IndexOf("-104") > -1)
{
msg = "数据包没号码或号码个数不足产品规定的最小阀值";
}
else if (bval.IndexOf("-105") > -1)
{
msg = "内容长度错";
}
else if (bval.IndexOf("-106") > -1)
{
msg = "无发送额度";
}
else if (bval.IndexOf("-107") > -1)
{
msg = "系统维护中";
}
else if (bval.IndexOf("-108") > -1)
{
msg = "未知错误中";
}
else
{
msg = "未知错误中2";
}
res = string.Format("发送失败:{0}", msg);
}
return res;
}