You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.6 KiB
58 lines
1.6 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading;
|
|
using Stone.Common;
|
|
|
|
namespace Stone.WinBiz.JISAdmin
|
|
{
|
|
public class F_SMS
|
|
{
|
|
private static string sms_message = "";
|
|
|
|
public static void SendSMS(string msg)
|
|
{
|
|
sms_message = msg;
|
|
|
|
Thread t_sms = new Thread(SendSMS);
|
|
t_sms.Start();
|
|
}
|
|
|
|
private static void SendSMS()
|
|
{
|
|
try
|
|
{
|
|
string number = MyAppconfig.ReadValue("手机号").Trim();
|
|
if (number == "") return;
|
|
|
|
if (sms_message == "") return;
|
|
|
|
|
|
MyHttpClient hc = new MyHttpClient();
|
|
|
|
string url = "http://sdk2.entinfo.cn:8061/mdsmssend.ashx?sn={0}&pwd={1}&mobile={2}&content={3}&ext=&stime=&rrid=&msgfmt=";
|
|
object[] obj = new object[10];
|
|
obj[0] = "SDK-BBX-010-21321";
|
|
obj[1] = Stone.Common.MyStrings.GetMD5String(obj[0].ToString() + "0b3)51-)").ToUpper();
|
|
obj[2] = number;
|
|
obj[3] = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + " JIS5000 " + sms_message + " 【沈阳名华】";
|
|
url = string.Format(url, obj);
|
|
|
|
|
|
|
|
string ret = hc.GetData(url);
|
|
|
|
sms_message = "";
|
|
|
|
MyLogger.Write("发送手机[" + number + "],发送内容[" + obj[3].ToString() + "],返回结果为:" + ret);
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MyLogger.Write(ex.Message);
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|