通过VB.Net应用程序发送短信 [英] SMS through VB.Net Application

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

问题描述

大家好,
关于SMS,如何通过VB.net应用程序将SMS设备连接到USB端口的情况下发送SMS.

Hi all,
Regarding SMS, through VB.net application, how can we send the SMS where a SMS device is Connected to USB Port. Anybody having the information please let me know?

推荐答案

链接-
使用VB.NET对SMS和EMS进行编码 [ vb.net AT命令发送短信 [在vb.net中使用GSM调制解调器发送短信 [ ^ ]
Links -
Using VB.NET to Encode SMS and EMS[^]
vb.net AT commands to send SMS[^]
sending sms with GSM Modem in vb.net[^]


尝试一下..

TRY this..

Dim SMSEngine As New SMSCOMMS("COM4")

'the port needs to be initialised

SMSPort = New SerialPort
        With SMSPort
            .PortName = COMMPORT
            .BaudRate = 19200
            .Parity = Parity.None
            .DataBits = 8
            .StopBits = StopBits.One
            .Handshake = Handshake.RequestToSend
            .DtrEnable = True
            .RtsEnable = True
            .NewLine = vbCrLf
        End With


        'this is  the set of AT commands to be written on serial port

            SMSPort.WriteLine("AT")
            'set command message format to text mode(1)
            SMSPort.WriteLine("AT+CMGF=1" & vbCrLf)
            'set service center address (which varies for service providers (idea, airtel))
            SMSPort.WriteLine("AT+CSCA=""+919822078000""" & vbCrLf)
            ' enter the mobile number whom you want to send the SMS
            SMSPort.WriteLine("AT+CMGS=  + TextBox1.text + " & vbCrLf)
            _ContSMS = False
            SMSPort.WriteLine("+ TextBox1.text +" & vbCrLf & Chr(26)) 'SMS sending

    Dim i As Integer
    Private Sub Button1_Click(ByVal sender As System.Object,
       ByVal e As System.EventArgs) Handles Button1.Click

        SMSEngine.Open() 'open the port
        SMSEngine.SendSMS() 'send the SMS

    End Sub


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

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