华域联盟 .Net ASP.NET(VB)写的后台发送短信实现代码

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()

您可能感兴趣的文章:

  • 通过第三方接口发送短信验证码/短信通知(推荐)
  • NodeJS实现阿里大鱼短信通知发送
  • asp.net调用飞信免费发短信(测试有效)
  • 阿里大鱼简单发送短信功能.net core版
  • C#代码实现短信验证码接口示例
  • C#怎么实现手机短信发送功能
  • java、php、C#、asp实现短信群发功能的方法
  • CDMA 猫用AT命令发中文短信(C#)
  • ASP.NET MVC阿里大于短信接口开发短信群发能

本文由 华域联盟 原创撰写:华域联盟 » ASP.NET(VB)写的后台发送短信实现代码

转载请保留出处和原文链接:https://www.cnhackhy.com/47153.htm

本文来自网络,不代表华域联盟立场,转载请注明出处。

作者: sterben

发表回复

联系我们

联系我们

2551209778

在线咨询: QQ交谈

邮箱: [email protected]

工作时间:周一至周五,9:00-17:30,节假日休息

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部