ASP.NET(VB)写的后台发送短信实现代码

一弯拱桥对映着一弯晓月,桥下流水波光粼粼,昙花一般的月,在我眼中异香腾风,秀色媚景。夜的静谧是风景,昼的明媚是风景。江花胜火红,寒山伤心碧,空伫玉阶白,西风残照黄。处处皆风景,处处皆绝妙风景。
 
Dim postData As String
Dim byteArray As Byte()
Dim objWebRequest As HttpWebRequest
Dim newStream As Stream postData = "cell=短信供应商提供信息1&enterpriseId=短信供应商提供信息2&mobile=手机号1,手机号2&message=发送数据测试。。。"
objWebRequest = WebRequest.Create("http://xxx.yyy.com.cn/SmsSend.jsp")
objWebRequest.Method = "POST"
objWebRequest.ContentType = "application/x-www-form-urlencoded" byteArray = System.Text.Encoding.UTF8.GetBytes(postData)
objWebRequest.ContentLength = byteArray.Length
newStream = objWebRequest.GetRequestStream()
newStream.Write(byteArray, 0, byteArray.Length)
newStream.Close() '返回数据
Dim response As HttpWebResponse
Dim sr As StreamReader
Dim textResponse As String
response = objWebRequest.GetResponse()
sr = New StreamReader(response.GetResponseStream(), System.Text.Encoding.Default)
textResponse = sr.ReadToEnd()

到此这篇关于ASP.NET(VB)写的后台发送短信实现代码就介绍到这了。狠抓基础是成功的基础 持之以恒是胜利的保证更多相关ASP.NET(VB)写的后台发送短信实现代码内容请查看相关栏目,小编编辑不易,再次感谢大家的支持!

标签: 发送短信 ASP