Esempio n. 1
0
        public static string SMSSend(string phone, string smsTemplate, int smsType)
        {
            if (!TextHandler.CheckMobile(phone))
            {
                return("{\"code\":\"0001\",\"msg\":\"手机号格式有误\"}");
            }
            string code = getVerifCode;

            try
            {
                string msg    = string.Format(smsTemplate, code);
                string url    = "http://xtx.telhk.cn:8888/sms.aspx?action=send&userid=5901&account=a10375&password=21541244&mobile=" + phone + "&content=" + msg + "&sendTime=&mobilenumber=1&countnumber=1&telephonenumber=0";
                string retMsg = WebSendMessage(url, "UTF-8", "post", msg);
                if (getXmlDocument(retMsg).Equals("ok"))
                {
                    return("{\"code\":\"0000\",\"msg\":\"验证码发送成功\"}");
                }
                else
                {
                    return("{\"code\":\"0001\",\"msg\":\"" + getXmlDocument(retMsg) + "\"}");
                }
            }
            catch
            {
                return("{\"code\":\"0001\",\"msg\":\"验证码发送失败\"}");
            }
        }