コード例 #1
0
ファイル: Service.cs プロジェクト: Shikyoh/HSWB2B2C
        private string SendMessage(string destination, string text, string speed = "0")
        {
            string str;

            if (string.IsNullOrWhiteSpace(destination))
            {
                str = "发送目标不能为空!";
            }
            else
            {
                MessageSMSConfig config = SMSCore.GetConfig();
                SortedDictionary <string, string> strs = new SortedDictionary <string, string>()
                {
                    { "mobiles", destination },
                    { "text", text },
                    { "appkey", config.AppKey },
                    { "sendtime", DateTime.Now.ToString() },
                    { "speed", speed }
                };
                Dictionary <string, string> strs1 = SMSAPiHelper.Parameterfilter(strs);
                string str1 = SMSAPiHelper.BuildSign(strs1, config.AppSecret, "MD5", "utf-8");
                strs1.Add("sign", str1);
                strs1.Add("sign_type", "MD5");
                str = SMSAPiHelper.PostData("http://sms.kuaidiantong.cn/SendMsg.aspx", SMSAPiHelper.CreateLinkstring(strs1));
            }
            return(str);
        }
コード例 #2
0
        public string GetSMSAmount()
        {
            var    config   = SMSCore.GetConfig();
            string postdata = "method=getAmount&appkey=" + config.AppKey;

            return(SMSAPiHelper.PostData("http://sms.kuaidiantong.cn/GetAmount.aspx", postdata));
        }
コード例 #3
0
ファイル: Service.cs プロジェクト: Shikyoh/HSWB2B2C
        public string GetSMSAmount()
        {
            MessageSMSConfig config = SMSCore.GetConfig();
            string           str    = string.Concat("method=getAmount&appkey=", config.AppKey);

            return(SMSAPiHelper.PostData("http://sms.kuaidiantong.cn/GetAmount.aspx", str));
        }
コード例 #4
0
 private void BatchSendMessage(string[] destination, string text)
 {
     if (destination.Length > 0)
     {
         var config = SMSCore.GetConfig();
         SortedDictionary <string, string> tmpParas = new SortedDictionary <string, string>();
         tmpParas.Add("mobiles", string.Join(",", destination));
         tmpParas.Add("text", text);
         tmpParas.Add("appkey", config.AppKey);
         tmpParas.Add("sendtime", DateTime.Now.ToString());
         tmpParas.Add("speed", "1");
         Dictionary <string, string> paras = SMSAPiHelper.Parameterfilter(tmpParas);
         string sign = SMSAPiHelper.BuildSign(paras, config.AppSecret, "MD5", "utf-8");
         paras.Add("sign", sign);
         paras.Add("sign_type", "MD5");
         string postdata = SMSAPiHelper.CreateLinkstring(paras);
         SMSAPiHelper.PostData("http://sms.kuaidiantong.cn/SendMsg.aspx", postdata);
     }
 }
コード例 #5
0
 private string SendMessage(string destination, string text, string speed = "0")
 {
     if (!string.IsNullOrWhiteSpace(destination))
     {
         var config = SMSCore.GetConfig();
         SortedDictionary <string, string> tmpParas = new SortedDictionary <string, string>();
         tmpParas.Add("mobiles", destination);
         tmpParas.Add("text", text);
         tmpParas.Add("appkey", config.AppKey);
         tmpParas.Add("sendtime", DateTime.Now.ToString());
         tmpParas.Add("speed", speed);
         Dictionary <string, string> paras = SMSAPiHelper.Parameterfilter(tmpParas);
         string sign = SMSAPiHelper.BuildSign(paras, config.AppSecret, "MD5", "utf-8");
         paras.Add("sign", sign);
         paras.Add("sign_type", "MD5");
         string postdata = SMSAPiHelper.CreateLinkstring(paras);
         return(SMSAPiHelper.PostData("http://sms.kuaidiantong.cn/SendMsg.aspx", postdata));
     }
     return("发送目标不能为空!");
 }
コード例 #6
0
ファイル: Service.cs プロジェクト: Shikyoh/HSWB2B2C
 private void BatchSendMessage(string[] destination, string text)
 {
     if (destination.Length > 0)
     {
         MessageSMSConfig config = SMSCore.GetConfig();
         SortedDictionary <string, string> strs = new SortedDictionary <string, string>()
         {
             { "mobiles", string.Join(",", destination) },
             { "text", text },
             { "appkey", config.AppKey },
             { "sendtime", DateTime.Now.ToString() },
             { "speed", "1" }
         };
         Dictionary <string, string> strs1 = SMSAPiHelper.Parameterfilter(strs);
         string str = SMSAPiHelper.BuildSign(strs1, config.AppSecret, "MD5", "utf-8");
         strs1.Add("sign", str);
         strs1.Add("sign_type", "MD5");
         SMSAPiHelper.PostData("http://sms.kuaidiantong.cn/SendMsg.aspx", SMSAPiHelper.CreateLinkstring(strs1));
     }
 }
コード例 #7
0
ファイル: SMSAPiHelper.cs プロジェクト: Shikyoh/HSWB2B2C
        public static string BuildSign(Dictionary <string, string> dicArray, string key, string sign_type, string _input_charset)
        {
            string str = string.Concat(SMSAPiHelper.CreateLinkstring(dicArray), key);

            return(SMSAPiHelper.Sign(str, sign_type, _input_charset));
        }