如何使用Vb.Net发送发送短信 [英] How Do I Send Send Sms Message Using Vb.Net

查看:269
本文介绍了如何使用Vb.Net发送发送短信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让一个系统在客户快到DUE DATE时发送短信...



谢谢

解决方案

请参考



http://stackoverflow.com/questions/21131761/sending-sms-using-vb-net [ ^ ]



< a href =http://www.vianett.com/en/developers/api-code-examples/vb-net> http://www.vianett.com/en/developers/api-code-examples/vb -net [ ^ ]



使用VB.NET发送批量短信 [ ^ ]



https://www.clickatell.com/apis-scripts/scripts/vb-net/ [ ^ ]


尝试这个你应该调用这个类的函数根据您的要求。





进口系统

进口System.IO

进口System.Net

进口System.Text

进口System.Web



公共舱fMain



Private Sub bSend_Click(ByVal sender As System.Object,ByVal e As System.EventArgs)处理bSend.Click

Dim request As HttpWebRequest

昏暗的响应因为HttpWebResponse = Nothing

Dim url As String

Dim username As String

Dim password As String

Dim host As String

Dim originator As String



试试



host =http://127.0.0.1:9501

originator =06201234567

username =admin

password = abc123



url = host +/ api?action = sendmessage&_

& username =&HttpUtility.UrlEncode(用户名)_

&&password =+ HttpUtility.UrlEncode(密码)_

&&recipient =+ HttpUtility.UrlEncode (tbReceiver.Text)_

&&messagetype = SMS:TEXT_

&&messagedata =+ HttpUtility.UrlEncode(tbMessage.Text)_

&&originator =+ HttpUtility.UrlEncode(创始人)_

&&serviceprovider = GSMModem1_

&&responseformat = html



request = DirectCast(WebRequest.Create(url),HttpWebRequest)



response = DirectCast(request.GetResponse() ,HttpWebResponse)



MessageBox.Show(Response:&response.StatusDescription)



Catch ex作为例外

结束尝试

结束子

结束类

Im trying to make a System to send SMS message when the customer is almost to their DUE DATE...

THANKS

解决方案

Please refer

http://stackoverflow.com/questions/21131761/sending-sms-using-vb-net[^]

http://www.vianett.com/en/developers/api-code-examples/vb-net[^]

Sending Bulk Sms Using VB.NET[^]

https://www.clickatell.com/apis-scripts/scripts/vb-net/[^]


Try this one you should call this class functions based on your requirements.


Imports System
Imports System.IO
Imports System.Net
Imports System.Text
Imports System.Web

Public Class fMain

Private Sub bSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bSend.Click
Dim request As HttpWebRequest
Dim response As HttpWebResponse = Nothing
Dim url As String
Dim username As String
Dim password As String
Dim host As String
Dim originator As String

Try

host = "http://127.0.0.1:9501"
originator = "06201234567"
username = "admin"
password = "abc123"

url = host + "/api?action=sendmessage&" _
& "username=" & HttpUtility.UrlEncode(username) _
& "&password=" + HttpUtility.UrlEncode(password) _
& "&recipient=" + HttpUtility.UrlEncode(tbReceiver.Text) _
& "&messagetype=SMS:TEXT" _
& "&messagedata=" + HttpUtility.UrlEncode(tbMessage.Text) _
& "&originator=" + HttpUtility.UrlEncode(originator) _
& "&serviceprovider=GSMModem1" _
& "&responseformat=html"

request = DirectCast(WebRequest.Create(url), HttpWebRequest)

response = DirectCast(request.GetResponse(), HttpWebResponse)

MessageBox.Show("Response: " & response.StatusDescription)

Catch ex As Exception
End Try
End Sub
End Class


这篇关于如何使用Vb.Net发送发送短信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆