If YOU want to make your application can send sms below is a visual basic code for sending sms.
Yes this is simple vb code for sending sms.
Often people want to make transactions credit with sms software.
ok just below is its form:
below is complete code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton1.Click
COMport.PortName = cboCOMPort.Text
COMport.BaudRate = 19200
COMport.WriteTimeout = 2000
Try COMport.Open()
Catch ex As Exception
MsgBox(ex.Message)
End Try Sleep(300) '....waiting 0.3 seconds tunda = 300
Sleep(tunda)
Below sended SMS to My Hanphone:
Imports System.IO.PortsImports System.Threading.ThreadPublic Class Form1 Private Tunda As Integer
Private WithEvents COMport As New SerialPort Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
For Each COMString As String In My.Computer.Ports.SerialPortNames
cboCOMPort.Items.Add(COMString)
Next cboCOMPort.Sorted = True End Sub
Private WithEvents COMport As New SerialPort Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
For Each COMString As String In My.Computer.Ports.SerialPortNames
cboCOMPort.Items.Add(COMString)
Next cboCOMPort.Sorted = True End Sub
COMport.PortName = cboCOMPort.Text
COMport.BaudRate = 19200
COMport.WriteTimeout = 2000
Try COMport.Open()
Catch ex As Exception
MsgBox(ex.Message)
End Try Sleep(300) '....waiting 0.3 seconds tunda = 300
Sleep(tunda)
Application.DoEvents()
If COMport.IsOpen Then
Try
Dim x As String = "AT+CMGF=1" & Chr(13)
COMport.Write(x)
Sleep(tunda)
Dim y As String = "AT+CMGS=" & Chr(34) & txtNoHP.Text & Chr(34) & Chr(13)
COMport.Write(y)
Sleep(tunda)
Dim z As String = txtPesan.Text & Chr(26)
COMport.Write(z)
Sleep(tunda)
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
MsgBox("COM port tertutup.")
End If
End SubEnd Class
If COMport.IsOpen Then
Try
Dim x As String = "AT+CMGF=1" & Chr(13)
COMport.Write(x)
Sleep(tunda)
Dim y As String = "AT+CMGS=" & Chr(34) & txtNoHP.Text & Chr(34) & Chr(13)
COMport.Write(y)
Sleep(tunda)
Dim z As String = txtPesan.Text & Chr(26)
COMport.Write(z)
Sleep(tunda)
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
MsgBox("COM port tertutup.")
End If
End SubEnd Class