<pre id="4qa46"></pre>

  • <dl id="4qa46"><acronym id="4qa46"></acronym></dl>
    <rt id="4qa46"></rt>
    <abbr id="4qa46"><tbody id="4qa46"></tbody></abbr>
  • ASP.NET(C#)

    ASP.NET(C#)代碼示例

    //接口類型:達(dá)信通觸發(fā)短信接口,支持發(fā)送驗(yàn)證碼短信、訂單通知短信等。
    //賬戶注冊(cè):請(qǐng)通過(guò)該地址開(kāi)通賬戶http://sms.wx96.com/register.html
    //注意事項(xiàng):
    //(1)調(diào)試期間,請(qǐng)用默認(rèn)的模板進(jìn)行測(cè)試,默認(rèn)模板詳見(jiàn)接口文檔;
    //(2)請(qǐng)使用 用戶名(例如:cf_demo123)及 APIkey來(lái)調(diào)用接口,APIkey在會(huì)員中心可以獲??;
    //(3)該代碼僅供接入達(dá)信通短信接口參考使用,客戶可根據(jù)實(shí)際需要自行編寫(xiě);
     
    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.IO;
    using System.Net;
    using System.Text;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
     
    public partial class Post : System.Web.UI.Page
    {
        public static string PostUrl = ConfigurationManager.AppSettings["WebReference.Service.PostUrl"];
        protected void Page_Load(object sender, EventArgs e)
        {
            string account = "用戶名";//用戶名是登錄wx96.com賬號(hào)名(例如:cf_demo123)
            string password = "密碼"; //請(qǐng)登錄用戶中心->驗(yàn)證碼、通知短信->帳戶及簽名設(shè)置->APIKEY
            string mobile = Request.QueryString["mobile"];
            Random rad = new Random();
            int mobile_code = rad.Next(1000, 10000);
            string content = "您的驗(yàn)證碼是:" + mobile_code + " 。請(qǐng)不要把驗(yàn)證碼泄露給其他人。";
             
            //Session["mobile"] = mobile;
            //Session["mobile_code"] = mobile_code;
             
            string postStrTpl = "account={0}&password={1}&mobile={2}&content={3}";
     
            UTF8Encoding encoding = new UTF8Encoding();
            byte[] postData = encoding.GetBytes(string.Format(postStrTpl, account, password, mobile, content));
     
            HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(PostUrl);
            myRequest.Method = "POST";
            myRequest.ContentType = "application/x-www-form-urlencoded";
            myRequest.ContentLength = postData.Length;
     
            Stream newStream = myRequest.GetRequestStream();
            // Send the data.
            newStream.Write(postData, 0, postData.Length);
            newStream.Flush();
            newStream.Close();
     
            HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse();
            if (myResponse.StatusCode == HttpStatusCode.OK)
            {
                StreamReader reader = new StreamReader(myResponse.GetResponseStream(), Encoding.UTF8);
     
                   //Response.Write(reader.ReadToEnd());
     
                   string res = reader.ReadToEnd();
                   int len1 = res.IndexOf("/code>");
                   int len2 = res.IndexOf("code>");
                   string code=res.Substring((len2+6),(len1-len2-6));
                   //Response.Write(code);
                   int len3 = res.IndexOf("/msg>");
                   int len4 = res.IndexOf("msg>");
                   string msg=res.Substring((len4+5),(len3-len4-5));
                   Response.Write(msg);
                   Response.End();
               }else{
                    //訪問(wèn)失敗
               }
           }
       }
    
    
    在線咨詢
    電話咨詢

    服務(wù)熱線:

    4008 808 898

    服務(wù)熱線(工作時(shí)間):

    4008 808 898

    業(yè)務(wù)咨詢(非工作時(shí)間):

    4008 808 898

    售后咨詢(非工作時(shí)間):

    4008 808 898

    91亚洲国产成人久久精品网站| 一本伊大人香蕉久久网手机| 热久久这里是精品6免费观看| 亚洲精品国产字幕久久不卡| 久久国产成人精品| 久久久久亚洲精品无码蜜桃| 99久久精品国产第一页| 久久精品国产精品亜洲毛片| 久久国产精品视频一区| 久久久不卡国产精品一区二区| 久久天天躁狠狠躁夜夜躁2O2O| 中文字幕久久精品| 国产精品无码久久久久久久久久| 久久久九九有精品国产| 久久这里都是精品| 国内精品久久久人妻中文字幕| 人妻系列无码专区久久五月天| 久久国产精品成人免费| 精品人妻伦一二三区久久| 久久天堂AV女色优精品| 精品久久久久久久| 久久国产视频99电影| 性做久久久久免费观看| 久久久久久久国产a∨| 午夜一级做a爰片久久毛片| 国产91久久精品一区二区| 国产成人无码精品久久久性色| 国产成人综合久久精品尤物| 久久无码中文字幕东京热| 亚洲成人精品久久| 久久99精品一区二区三区| 久久精品国产亚洲| 亚洲色欲久久久久综合网| 热久久精品免费视频| 青青草在视线频久久| 色综合久久88色综合天天| 久久精品国产亚洲AV久| 久久久国产精品网站| 一本一本久久A久久综合精品| 久久天天躁狠狠躁夜夜2020| 久久国产香蕉一区精品|