Koneksi Modem Dengan Visual Basic

Koneksi modem mungkin dah pada tahu! tapi kalo koneksi modem dengan kode Visual Basic apa pada tahu?(mungkin…!!!)

Source ini di posting untuk menambah wawasan para programmer. Program ini digunakan untuk dial modem kemudian dalam beberapa detik koneksi modem diputus.

Program ini dapat dimodifikasi sesuai dengan selera yang akan menggunakan.

Dim a, b, c, d, e, f, g, h, i, j, k
Dim DialString$, FromModem$, dialing, flname

Private Sub Label1_Click()
notelp = “XXXXXXXXX”
Text1.Text = flname
‘ connect to modem and dial phone number
MSComm1.CommPort = 2
MSComm1.Settings = “115200,N,8,1”
On Error Resume Next
MSComm1.PortOpen = True
MSComm1.InBufferCount = 0
MSComm1.Output = “ATDT” + notelp + “;” + vbCr
Label3.Caption = “MODEM CONNECT”
Timer2.Enabled = True
End Sub

Private Sub Label2_Click()
‘ Disconnect the modem.
MSComm1.Output = “ATH” + vbCr
‘ Close the port.
MSComm1.PortOpen = False
If flname “” Then
Kill “d:\YYYYYYYY\” + flname
End If
End Sub

Private Sub Timer1_Timer()
Timer1.Enabled = False
Timer2.Enabled = False
flname = Dir(“d:\YYYYYYYYY\newfilecomming.txt”)
If flname “” Then
Label1_Click
End If
End Sub

Private Sub Timer2_Timer()
Label3.Caption = “MODEM DISCONNECT”
Label2_Click
Timer1.Enabled = True
End Sub

sumber : wahana programmer
email :snnugroho@plasma.co.id

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: