標籤:type method string pst == pass get https class
public static string PostUrl = "http://zapi.253.com/msg/HttpBatchSendSM"; static void Main(string[] args) { string account = ""; string password = ""; string mobile = "1"; string content = "您的登陸驗證碼是1234"; string postStrTpl = "account={0}&pswd={1}&mobile={2}&msg={3}&needstatus=true&product=&extno="; 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); myResponse.Close(); myRequest.Abort(); Console.WriteLine("發送成功"); Console.ReadKey(); } else { myRequest.Abort(); myResponse.Close(); Console.WriteLine("發送失敗"); Console.ReadKey(); } }
創藍Voice Messaging Service.net
創藍Voice Messaging Service(語音通知驗證碼).net