复制代码 代码如下:
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()
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()
标签:
发送短信,短信
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
狼山资源网 Copyright www.pvsay.com
暂无“ASP.NET(VB)写的后台发送短信实现代码”评论...