<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

    久久精品国产亚洲77777| 综合久久久久久中文字幕亚洲国产国产综合一区首 | 1313午夜精品久久午夜片| 国产成人综合久久| 久久亚洲精品国产精品| 四虎亚洲国产成人久久精品| 色综合久久中文字幕无码| 久久这里只有精品视频99| 色偷偷人人澡久久超碰97| 久久久久成人精品一区二区 | 久久精品国产99国产电影网| 精品久久久久久无码人妻中文字幕 | 久久精品嫩草影院| 国产精品久久久尹人香蕉| 2021年国产精品久久| 亚洲国产另类久久久精品| 一级做a爰片久久毛片一| 99久久这里只精品国产免费| 久久久国产乱子伦精品| 亚洲综合日韩久久成人AV| www.久久热.com| 久久久精品久久久久久96| 久久午夜夜伦鲁鲁片免费无码影视| 国内精品久久久久久久影视麻豆| 91精品国产色综久久| 久久国产亚洲电影天堂| 国内精品伊人久久久久| 精品无码人妻久久久久久| 精品人妻潮喷久久久又裸又黄| 99久久久久久久| 久久国产加勒比精品无码| 久久久国产精品网站| 国产色综合久久无码有码| 久久精品国产第一区二区| 伊人伊成久久人综合网777| 国内精品久久久久影院蜜芽| 亚洲欧美日韩综合久久久久| 2020久久精品国产免费| 亚洲香蕉久久一区二区三区四区| 久久综合九九亚洲一区| 伊人久久大香线蕉亚洲五月天|