<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á)信通國(guó)際短信接口。
    //賬戶注冊(cè):請(qǐng)通過(guò)該地址開(kāi)通賬戶http://sms.wx96.com/register.html
    //注意事項(xiàng):
    //(1)調(diào)試期間,請(qǐng)仔細(xì)閱讀接口文檔;
    //(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)登錄用戶中心->國(guó)際短信->帳戶參數(shù)設(shè)置->APIKEY
            string mobile = "136xxxxxxxx";//手機(jī)號(hào)碼
            string content = "Your verification code is 1125";
            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);
     
                   string res = reader.ReadToEnd();
                   //Response.Write(res);
                   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久久大香线蕉| 亚洲精品国精品久久99热| 亚洲精品无码专区久久| 精品国产一区二区三区久久蜜臀| 久久精品这里热有精品| 久久午夜无码鲁丝片秋霞| 久久国产精品-久久精品| 亚洲国产精品综合久久一线| 久久久久综合一本久道| 久久艳务乳肉豪妇荡乳a片| 久久夜色精品国产www| 久久人人爽人人爽人人片av麻烦| 好久久免费视频高清| 国产精品成人久久久久久久 | 伊人久久大香线蕉综合影| 亚洲国产美女精品久久久久| 国产精品青草久久久久福利99| 亚洲国产精品无码久久九九大片| 98久久人妻无码精品系列蜜桃| 国产成人久久久精品二区三区| 亚洲国产精品无码久久久秋霞1| 亚洲国产成人久久三区| 久久99九九99九九精品| 国产精品美女久久久久AV福利| 99v久久综合狠狠综合久久| 国产成人综合久久精品红 | 囯产精品久久久久久久久久妞妞| 久久久精品人妻一区二区三区蜜桃| 久久久久久久久久国产精品免费| 久久se精品一区精品二区| 亚洲午夜久久久影院| 中文精品久久久久人妻| 97久久精品午夜一区二区| 久久夜色撩人精品国产| 久久久久国产视频电影| 人妻少妇精品久久久久久| 久久综合鬼色88久久精品综合自在自线噜噜 | 99久久免费观看| 精品久久久久久中文字幕| 伊人久久大香线蕉观看| 精品综合久久久久久97超人|