LISTING PROGRAM Source Code Tampilan Awal Private Sub cmdkeluar_click() MsgBox "Terima Kasih Telah Membuka Program Ini.", vbinformation, "Quick IP Ver 1.0" End Private Sub cmdmasuk_click() MenuUtama.Show Source Code Menu Utama Private Sub About_Click() AboutForm.Show Private Sub cmdabout_click() AboutForm.Show Private Sub cmdkeluar_click() MsgBox "Terima Kasih Telah Membuka Program Ini.", vbinformation, "Quick IP Ver 1.0" End Private Sub cmdkirimpesan_click() PesanForm.Show Private Sub cmdpingtracert_click() PerintahForm.Show Private Sub cmdhitungip_click() MainForm.Show Private Sub Keluar_Click() End Private Sub KirimPesan_Click() PesanForm.Show
Private Sub PingTracer_Click() PerintahForm.Show Source Code Hitung IP 'Sub Operasi Network Address---------------------------------------------------------------- Sub OperasiNa() lblna1.caption = txtip1.text And txtnet1.text lblna2.caption = txtip2.text And txtnet2.text lblna3.caption = txtip3.text And txtnet3.text lblna4.caption = txtip4.text And txtnet4.text 'Sub Reset--------------------------------------------------------------------------------- Sub Reset() lblkelas.caption = "" lblna1.caption = "" lblna2.caption = "" lblna3.caption = "" lblna4.caption = "" lblba1.caption = "" lblba2.caption = "" lblba3.caption = "" lblba4.caption = "" lblth.caption = "" lblthv.caption = "" 'Masuk Form About-------------------------------------------------------------------------- Private Sub cmdabout_click() AboutForm.Show 'Ulangi------------------------------------------------------------------------------------ Private Sub cmdcoba_click() lblkelas.caption = "" txtip1.text = "" txtip2.text = "" txtip3.text = "" txtip4.text = "" txtnet1.text = "" txtnet2.text = ""
txtnet3.text = "" txtnet4.text = "" lblna1.caption = "" lblna2.caption = "" lblna3.caption = "" lblna4.caption = "" lblba1.caption = "" lblba2.caption = "" lblba3.caption = "" lblba4.caption = "" lblth.caption = "" lblthv.caption = "" txtip1.setfocus 'Pesan Keluar---------------------------------------------------------------------------- Private Sub cmdkeluar_click() MenuUtama.Show Private Sub cmdperintah_click() PerintahForm.Show Private Sub cmdkembali_click() MenuUtama.Show Private Sub cmdprs_click() 'IP1------------------------------------------------------------------------------------- If txtip1.text = "" Then MsgBox "IP Address prefix 1 masih kosong", vbcritical, "Kesalahan IP Address" txtip1.setfocus If Not IsNumeric(txtIp1.Text) Then MsgBox "IP Address prefix 1 harus berisi angka", vbcritical, "Kesalahan Penulisan IP Adddress" txtip1.setfocus If txtip1.text < 1 Or txtip1.text > 255 Then MsgBox "IP Address prefix 1 diluar jangkauan", vbcritical, "Kesalahan IP Address"
txtip1.setfocus 'IP2------------------------------------------------------------------------------------ If txtip2.text = "" Then MsgBox "IP Address prefix 2 masih kosong", vbcritical, "Kesalahan IP Address" txtip2.setfocus If Not IsNumeric(txtIp2.Text) Then MsgBox "IP Address prefix 2 harus berisi angka", vbcritical, "Kesalahan Penulisan IP Adddress" txtip2.setfocus If txtip2.text < 0 Or txtip2.text > 255 Then MsgBox "IP Address prefix 2 diluar jangkauan", vbcritical, "Kesalahan IP Address" txtip2.setfocus 'IP3------------------------------------------------------------------------------------ If txtip3.text = "" Then MsgBox "IP Address prefix 3 masih kosong", vbcritical, "Kesalahan IP Address" txtip3.setfocus If Not IsNumeric(txtIp3.Text) Then MsgBox "IP Address prefix 3 harus berisi angka", vbcritical, "Kesalahan Penulisan IP Adddress" txtip3.setfocus If txtip3.text < 0 Or txtip3.text > 255 Then MsgBox "IP Address prefix 3 diluar jangkauan", vbcritical, "Kesalahan IP Address" txtip3.setfocus 'IP4------------------------------------------------------------------------------------ If txtip4.text = "" Then MsgBox "IP Address prefix 4 masih kosong", vbcritical, "Kesalahan IP Address"
txtip4.setfocus If Not IsNumeric(txtIp4.Text) Then MsgBox "IP Address prefix 4 harus berisi angka", vbcritical, "Kesalahan Penulisan IP Adddress" txtip4.setfocus If txtip4.text < 0 Or txtip4.text > 255 Then MsgBox "IP Address prefix 4 diluar jangkauan", vbcritical, "Kesalahan IP Address" txtip4.setfocus 'Net1----------------------------------------------------------------------------------- If txtnet1.text = "" Then MsgBox "Subnet mask prefix 1 masih kosong", vbcritical, "Kesalahan Subnet Mask" txtnet1.setfocus If Not IsNumeric(txtNet1.Text) Then MsgBox "Subnet Mask prefix 1 harus berisi angka", vbcritical, "Kesalahan Penulisan Subnet Mask" txtnet1.setfocus If txtnet1.text <> 255 Then MsgBox "Subnet mask prefix 1 Salah. Prefix 1 hanya bisa diisi dengan 255", vbcritical, "Kesalahan Subnet mask" txtnet1.setfocus 'Net2----------------------------------------------------------------------------------- If txtnet2.text = "" Then MsgBox "Subnet mask prefix 2 masih kosong", vbcritical, "Kesalahan Subnet Mask" txtnet2.setfocus If Not IsNumeric(txtNet2.Text) Then
MsgBox "Subnet Mask prefix 2 harus berisi angka", vbcritical, "Kesalahan Penulisan Subnet Mask" txtnet2.setfocus If txtnet2.text <> 0 And _ txtnet2.text <> 128 And _ txtnet2.text <> 192 And _ txtnet2.text <> 224 And _ txtnet2.text <> 240 And _ txtnet2.text <> 248 And _ txtnet2.text <> 252 And _ txtnet2.text <> 254 And _ txtnet2.text <> 255 Then MsgBox "Subnet mask prefix 2 Salah. Prefix 2 hanya bisa diisi dengan: 0, 128, 192, 224, 240, 248, 252, 254 atau 255", vbcritical, "Kesalahan Subnet mask" txtnet2.setfocus 'Net3----------------------------------------------------------------------------------- If txtnet3.text = "" Then MsgBox "Subnet mask prefix 3 masih kosong", vbcritical, "Kesalahan Subnet Mask" txtnet3.setfocus If Not IsNumeric(txtNet3.Text) Then MsgBox "Subnet Mask prefix 3 harus berisi angka", vbcritical, "Kesalahan Penulisan Subnet Mask" txtnet3.setfocus If txtnet3.text <> 0 And _ txtnet3.text <> 128 And _ txtnet3.text <> 192 And _ txtnet3.text <> 224 And _ txtnet3.text <> 240 And _ txtnet3.text <> 248 And _ txtnet3.text <> 252 And _ txtnet3.text <> 254 And _ txtnet3.text <> 255 Then
MsgBox "Subnet mask prefix 3 Salah. Prefix 3 hanya bisa diisi dengan: 0, 128, 192, 224, 240, 248, 252, 254 atau 255", vbcritical, "Kesalahan Subnet mask" txtnet3.setfocus 'Net4----------------------------------------------------------------------------------- If txtnet4.text = "" Then MsgBox "Subnet mask prefix 4 masih kosong", vbcritical, "Kesalahan Subnet Mask" txtnet4.setfocus If Not IsNumeric(txtNet4.Text) Then MsgBox "Subnet Mask prefix 4 harus berisi angka", vbcritical, "Kesalahan Penulisan Subnet Mask" txtnet4.setfocus If txtnet4.text <> 0 And _ txtnet4.text <> 128 And _ txtnet4.text <> 192 And _ txtnet4.text <> 224 And _ txtnet4.text <> 240 And _ txtnet4.text <> 248 And _ txtnet4.text <> 252 And _ txtnet4.text <> 254 And _ txtnet4.text <> 255 Then MsgBox "Subnet mask prefix 4 Salah. Prefix 4 hanya bisa diisi dengan: 0, 128, 192, 224, 240, 248, 252, 254 atau 255", vbcritical, "Kesalahan Subnet mask" txtnet4.setfocus 'Menentukan Kelas------------------------------------------------------------------------ If txtnet1.text = 255 And _ txtnet2.text < 255 And _ txtnet3.text < 255 And _ txtnet4.text < 255 _ Then lblkelas.caption = "A" GoSub KelasA If txtnet1.text = 255 And _
txtnet2.text = 255 And _ txtnet3.text < 255 And _ txtnet4.text < 255 Then lblkelas.caption = "B" GoSub KelasB If txtnet1.text = 255 And _ txtnet2.text = 255 And _ txtnet3.text = 255 And _ txtnet4.text < 255 _ Then lblkelas.caption = "C" GoSub KelasC If txtnet1.text = 255 And _ txtnet2.text = 255 And _ txtnet3.text = 255 And _ txtnet4.text = 255 Then lblkelas.caption = "D atau E" MsgBox "Program ini hanya untuk kelas A, B, dan C", vbexclamation, "Batasan" lblna1.caption = "" lblna2.caption = "" lblna3.caption = "" lblna4.caption = "" lblba1.caption = "" lblba2.caption = "" lblba3.caption = "" lblba4.caption = "" lblth.caption = "" lblthv.caption = "" MsgBox "Format subnet mask salah", vbcritical, "Kesalahan Subnet Mask" 'Operasi Kelas A------------------------------------------------------------------------ KelasA: Call OperasiNa lblba1.caption = txtnet1.text lblba2.caption = 255 - txtnet2.text lblba3.caption = 255 - txtnet3.text lblba4.caption = 255 - txtnet4.text
lblth.caption = (256 - txtnet4.text) * (256 - txtnet3.text) * (256 - txtnet2.text) lblthv.caption = lblth.caption - 2 'Operasi Kelas B------------------------------------------------------------------------ KelasB: Call OperasiNa lblba1.caption = txtnet1.text lblba2.caption = txtnet2.text lblba3.caption = 255 - txtnet3.text lblba4.caption = 255 - txtnet4.text lblth.caption = (256 - txtnet4.text) * (256 - txtnet3.text) lblthv.caption = lblth.caption - 2 'Operasi Kelas C------------------------------------------------------------------------ KelasC: Call OperasiNa lblba1.caption = txtip1.text lblba2.caption = txtip2.text lblba3.caption = txtip3.text lblba4.caption = 255 - txtnet4.text lblth.caption = 256 - txtnet4.text lblthv.caption = lblth.caption - 2 Source Code Ping dan Tracert Private Sub cmdclear_click() If Dir("C:\*.bat") = "" Then MsgBox "Chace kosong", vbinformation, "Quick IP Ver 1.0" Kill "C:\*.bat" MsgBox "Chace sudah dibersihkan", vbinformation, "Quick IP Ver 1.0" 'Perintah Start Service-------------------------------------------------------------- Private Sub cmdstart_click() BatchStart RetVal = Shell("C:\start.bat", vbnormalfocus)
Sub BatchStart() fso.createtextfile ("C:\start.bat") Open "C:\start.bat" For Output As 1 Print #1, "net start messenger" 'Perintah Kembali------------------------------------------------------------------ Private Sub cmdkembali_click() MenuUtama.Show 'Perintah Kirim Pesan-------------------------------------------------------------- Private Sub cmdkrmpsn_click() If txtippsn.text = "" Then MsgBox "IP Address atau Nama Host masih kosong", vbcritical, "Kesalahan IP Address atau Nama Host" If txtpsn.text = "" Then MsgBox "Pesan masih kosong", vbcritical, "Kesalahan Pesan" BatchPesan RetVal = Shell("C:\pesan.bat", vbnormalfocus) Sub BatchPesan() fso.createtextfile ("C:\pesan.bat") Open "C:\pesan.bat" For Output As 1 Print #1, "net send " & txtippsn.text & " " & txtpsn.text 'Perintah Ping-------------------------------------------------------------------- Private Sub cmdping_click() If txtippt.text = "" Then MsgBox "IP Address atau Domain masih kosong", vbcritical, "Kesalahan IP Address atau Domain"
BatchPing RetVal = Shell("C:\ping.bat", vbnormalfocus) Sub BatchPing() fso.createtextfile ("C:\ping.bat") Open "C:\ping.bat" For Output As 1 Print #1, "ping " & txtippt.text & " -t" Print #1, "pause" Private Sub cmdreset_click() txtippt.text = "" txtippt.setfocus 'Perintah Scan-------------------------------------------------------------------- Private Sub cmdscan_click() BatchScan RetVal = Shell("C:\scan.bat", vbnormalfocus) Sub BatchScan() fso.createtextfile ("C:\scan.bat") Open "C:\scan.bat" For Output As 1 Print #1, "net view" Print #1, "pause" 'Perintah Start Service-------------------------------------------------------------- Private Sub cmdstop_click() BatchStop RetVal = Shell("C:\stop.bat", vbnormalfocus)
Sub BatchStop() fso.createtextfile ("C:\stop.bat") Open "C:\stop.bat" For Output As 1 Print #1, "net stop messenger" 'Perintah Tracert---------------------------------------------------------------- Private Sub cmdtracert_click() If txtippt.text = "" Then MsgBox "IP Address atau Domain masih kosong", vbcritical, "Kesalahan IP Address atau Domain" BatchTracert RetVal = Shell("C:\tracert.bat", vbnormalfocus) Sub BatchTracert() fso.createtextfile ("C:\ping.bat") Open "C:\tracert.bat" For Output As 1 Print #1, "tracert " & txtippt.text Print #1, "pause" Source Code Kirim Pesan Private Sub cmdclear_click() If Dir("C:\*.bat") = "" Then MsgBox "Chace kosong", vbinformation, "Quick IP Ver 1.0" Kill "C:\*.bat" MsgBox "Chace sudah dibersihkan", vbinformation, "Quick IP Ver 1.0" Private Sub cmdkembali_click() MenuUtama.Show
Private Sub cmdkrmpsn_click() If txtippsn.text = "" Then MsgBox "IP Address atau Nama Host masih kosong", vbcritical, "Kesalahan IP Address atau Nama Host" If txtpsn.text = "" Then MsgBox "Pesan masih kosong", vbcritical, "Kesalahan Pesan" BatchPesan RetVal = Shell("C:\pesan.bat", vbnormalfocus) Sub BatchPesan() fso.createtextfile ("C:\pesan.bat") Open "C:\pesan.bat" For Output As 1 Print #1, "net send " & txtippsn.text & " " & txtpsn.text Private Sub cmdreset_click() txtippsn.text = "" txtpsn.text = "" txtippsn.setfocus Private Sub cmdstart_click() BatchStart RetVal = Shell("C:\start.bat", vbnormalfocus) Sub BatchStart() fso.createtextfile ("C:\start.bat") Open "C:\start.bat" For Output As 1 Print #1, "net start messenger" Private Sub cmdstop_click()
BatchStop RetVal = Shell("C:\stop.bat", vbnormalfocus) Sub BatchStop() fso.createtextfile ("C:\stop.bat") Open "C:\stop.bat" For Output As 1 Print #1, "net stop messenger" Source Code About Private Sub cmdkembali_click() MenuUtama.Show Source Code Keluar Private Sub cmdkeluar_click() MsgBox "Terima Kasih Telah Membuka Program Ini.", vbinformation, "Quick IP Ver 1.0" End