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 = "http://sms.106jiekou.com/utf8/sms.aspx"; protected void Page_Load(object sender, EventArgs e) { } protected void ButSubmit_Click(object sender, EventArgs e) { string account = this.TxtAccount.Text.Trim(); string password = this.TxtPassword.Text.Trim(); string mobile = this.TxtMobile.Text.Trim(); string content = this.TxtContent.Text.Trim(); 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;charset=UTF-8"; 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); LabelRetMsg.Text = reader.ReadToEnd(); //反序列化upfileMmsMsg.Text //實(shí)現(xiàn)自己的邏輯 } else { //訪問(wèn)失敗 } } }
友情鏈接:106短信平臺(tái) | 發(fā)短信平臺(tái) | 短信接口平臺(tái) | 短信接口平臺(tái)哪個(gè)好 | 國(guó)際短信 | 短信通 | 短信接口應(yīng)用
關(guān)于我們 | 產(chǎn)品與服務(wù) | 解決方案 | 客戶案例 | 聯(lián)系我們 | 幫助指南 | 付款方式
Copyright © 2008-2018 短信通 . 速度網(wǎng)絡(luò)有限公司 短信接口應(yīng)用第一平臺(tái) All rights reserved. 浙ICP備10040624號(hào)-2