Download - Documentation Billing Nggleling
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
Kurei Azure Software [ Hypesoft silent System.Inc ]Judul Proyek : Aplikasi Software Billing dengan VB 6.0
Produk : Program Aplikasi Billing Nggleling 1.0
Deskripsi : Program aplikasi Billing Nggleling salah satu jenis aplikasi yang dibuat dengan bahasa pemrograman visual basic.Aplikasi ini berfungsi sebagai penghitung waktu atau timer, yang masih simple karena masih menggunakan bahasa pemrograman tingkat dasar didukung dengan pengetahuan programmer yang juga masih tingkat dasar.
Desain Produk
1.Server
Silent_System : Guide Back to The Right Track Halaman 1 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
2.Client
Logika Program
Berikut Logika Program Aplikasi Billing Nggleling :
1. Pada komputer client muncul lock komputer sebelum client log in.2. Client Log In dan Connect dengan server.3. Biaya bertambah seiring waktu yang berjalan dan sesuai setting waktu.4. Antar Client Dapat melakukan chatting/saling mengirim pesan.5. Data client akan dikirim saat client selesai.6. Aktifkan server terlebih dahulu sebelum client log in dan client tidak dapat melakukan log in jika
tidak ada koneksi dengan server.7. Komputer client akan restart secara otomatis setelah client selesai menggunakan komputer
tersebut.Untuk lebih lengkap berikut Logika Pada form Billing Client:
Form tiro ( Intreface antar user dengan Progam )1. Logika untuk pilihan Menu:
a. File
Silent_System : Guide Back to The Right Track Halaman 2 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
Message
Event : click
Akan muncul tools untuk melakukan pengiriman pesan
Calendar
Event : click
Menampilkan calendar saat billing digunakan
Disconnect
Event : click
Menutup koneksi ke server dan memunculkan form lock komputer
Show Time
Event : click
Menampilakan jam waktu setempat
About
Event : click
Menampilkan form about
Show Price
Event : click
Menampilkan harga sesuai yang tertera pada label.
b. View
Internet Explorer
Event : click
Akan menjalankan progam web broser Internet Exporer (Iexporer.exe)
Mozilla
Event : click
Akan menjalankan progam web broser Mozilla(mozilla.exe)
Yahoo
Event : click
Menjalankan progam web broser Internet Exporer dengan URL otomatis http://yahoo.com
Event : click
Menjalankan progam web broser Internet Exporer dengan URL otomatis http://google.com atau http://google.co.id
c. Help
Message
Event : click
Silent_System : Guide Back to The Right Track Halaman 3 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
Dengan message diharapkan clien yang mengalami kesulitan dapat mengirimkan pesan kepada server.
About
Event : click
Menampilkan tentang pembuat progam
Form log ( Form untuk Lock Komputer )a. Tombol log in ( personal )
Event : click
Saat di click akan muncul kotak pengisian username.b. Tombol log in ( Administrator )
Event : click
Pintu log in bagi admin dilengkapi dengan passwordc. Tombol Help
Event : click
Memunculkan informasi cara log inSistematika Kerja
1. Mendesain Form Interface
Hasil analisa : dibutuhkan beberapa buah interface1.Server = 1 buah interface2.Client = 7 buah interface
***********************Mendesain Server**************************
Interface
Pada program ini interface utama menggunakan component / objek Form:Daftar property yang dimodifikasi / disetting ulang nilainyaForm Server :
No Property Value1 Caption Server2 Height Sesuaikan3 Icon (Icon) disesuaikan4 Picture (Bitmap) disesuaikan5 Property lain Disesuaikan sesuai kebutuhan
Untuk lebih lanjut silahkan lihat gambar berikut :Gambar dibawah ini menunjukkan properties form server yang telah dibuat.Untuk properties dapat disesuaikan tergantung dari keinginan sang pembuat progam:
Silent_System : Guide Back to The Right Track Halaman 4 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
Tambahan Component Pada Server: Label
a. Label 1 Sebagai sarana menampilkan IP computer yang sedang digunakan Source code :Pada form load >> Label1.Caption = Winsock1(0).LocalIP
b. Label 2 Sebagai sarana menampilkan hosname computer yang sedang digunakan Source code : Pada form load >>Label2.Caption = Winsock1(0). Winsock1(0).LocalHostName
c. Label 3 Sebagai sarana menampilkan port sedang digunakan sebagai koneksi Source code : Pada form load >> Label3.Caption = "I Wait On Port : " & Winsock1(0).LocalPort
d. Label 4 Sebagai sarana menampilkan kondisi koneksi winsock. Source code : Terletak pada timer :
Private Sub Timer1_Timer()'mengetahui status winsock connectionLabel4.Caption = "Connection Status : " & Winsock1(0).StateIf Winsock1(0).State = 0 Then
Silent_System : Guide Back to The Right Track Halaman 5 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
Label4.Caption = "Connection Status : Disconnected"ElseIf Winsock1(0).State = 1 ThenLabel4.Caption = "Connection Status : Open Connection "ElseIf Winsock1(0).State = 2 ThenLabel4.Caption = "Connection Status : Listening "ElseIf Winsock1(0).State = 3 ThenLabel4.Caption = "Connection Status : Connection Pending "ElseIf Winsock1(0).State = 4 ThenLabel4.Caption = "Connection Status : Resolving Host "ElseIf Winsock1(0).State = 5 ThenLabel4.Caption = "Connection Status : Host Resolved "ElseIf Winsock1(0).State = 6 ThenLabel4.Caption = "Connection Status : Connecting"ElseIf Winsock1(0).State = 7 ThenLabel4.Caption = "Connection Status : Connected "ElseIf Winsock1(0).State = 8 ThenLabel4.Caption = "Connection Status : Peer is closing the Connection"ElseIf Winsock1(0).State = 9 ThenLabel4.Caption = "Connection Status : Error "End IfEnd Sub
e. Label 5 Sebagai nama Incoming Message. f. Label 6 Sebagai nama Outgoing Message. g. Label 7 Sebagai nama dari penunjuk client saat start h. Label 8 Sebagai judul dari penunjuk harga i. Label 9 Sebagai judul dari penunjuk client saat selesai (finish )j. Label 10 Sebagai judul dari tombol untuk kill client
Lista. List 1 Sebagai informasi winsock saat winsock start ,close atau listening dai
menampilkan informasi saat ada client yang login . Source code : terletek pada :Winsock1_ConnectionRequest:
Private Sub Winsock1_ConnectionRequest(Index As Integer, ByVal requestID As Long)'Memunculkan informasi saat request koneksi dari clientintSckCnt = intSckCnt + 1Load Winsock1(intSckCnt)Winsock1(intSckCnt).Accept requestIDList1.AddItem "There Are Client : " & intSckCnt & " Connection From : " & Winsock1(intSckCnt).RemoteHostIPText4 = Text4 & " Client Nick : Client " & intSckCntWinsock1(intSckCnt).SendData "Your Nick Is ""Client" & intSckCnt & """"List1.ListIndex = List1.ListCount - 1x = Time()Text1.Text = "Client : " & intSckCnt & " Start at : " & x & vbCrLfCommand2(intSckCnt - 1).Enabled = TrueEnd Sub
b. List 2 Sebagai sarana untuk menampilkan pesan yang datang.Source code : terletek pada : Winsock1_DataArrival:
Private Sub Winsock1_DataArrival(Index As Integer, ByVal
Silent_System : Guide Back to The Right Track Halaman 6 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
bytesTotal As Long)'pengambilan data saat data tibaDim strData As StringDim init As IntegerWinsock1(Index).GetData strData, vbStringText5.Text = "Client " & Index & " : " & strDataIf Text5.Text = rp Then List3.AddItem Text5.TextFor init = 0 To intSckCnt If Not init = Index Then If Winsock1(init).State = sckConnected Then Winsock1(init).SendData "Client" & Index & " : " & strData End If End IfNext initEnd Sub
c. List 3 Sebagai sarana untuk menampilkan jumlah harga client.Source code : terletek pada : Winsock1_DataArrival:
If (Mid(Text5.Text, 12, 2) = "Rp") Or (Mid(Text5.Text, 13, 2) = "Rp") Then List3.AddItem Text5.Text
Text boxa. Text1Menampilkan informasi saat client start.
Source code : terletek pada : Winsock1_ ConnectionRequest:Text1.Text = "Client : " & intSckCnt & " Start at : " & x & vbCrLf
b. Text2Sarana untuk memasukkan text yang akan dikirim dalam message.c. Text4 Sarana untuk menampilkan nick client
Source code : terletek pada : Winsock1_ ConnectionRequest:Text4 = Text4 & " Client Nick : Client " & intSckCntText4
d. Text5 Sarana untuk menampilkan pesan yang dikirim dan diterima saat chatingSource code : terletek pada : Winsock1_DataArrival:Text5.Text = "Client " & Index & " : " & strDataPada : send_ClickPrivate Sub send_Click()'pengiriman dataOn Error Resume NextDim init As Integer For init = 1 To (Winsock1.Count - 1) If Winsock1(init).State = sckConnected Then Winsock1(init).SendData "Server : " & Text2.Text End If Text5 = "Server : " & Text2.Text & vbCrLf Next List2.AddItem "Server : " & Text2.TextEnd Sub
e. Menampilkan informasi saat client finish.Source code : terletek pada : Winsock1_ DataArrival:If (Mid(Text5.Text, 12, 2) = "Rp") Or (Mid(Text5.Text, 13, 2) = "Rp") Then List3.AddItem Text5.TextIf (Mid(Text5.Text, 12, 2) = "Rp") Or (Mid(Text5.Text, 13, 2) = "Rp") ThenText6.Text = "Client : " & intSckCnt & " Finish at : " &
Silent_System : Guide Back to The Right Track Halaman 7 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
Time() & vbCrLf Button / Command
a. CmdStartMembuka koneksi winsockSource code :Saat di click:
Private Sub cmdStart_Click()'memulai koneksiTimer1.Interval = 100Timer2.Interval = 100List1.AddItem "I Wait to Kill You On Port : " & Winsock1(0).LocalPortcmdStart.Enabled = FalseDis.Enabled = TrueWinsock1(0).ListenEnd Sub
b. CmdStartMenutup koneksi winsockSource code :Saat di click:
Private Sub Dis_Click()'Menutup koneksiTimer1.Interval = 0Timer2.Interval = 0cmdStart.Enabled = TrueDis.Enabled = FalseWinsock1(0).CloseList1.AddItem "No Connection"End Sub
c. Send Mengirim MessageSource code :Saat di click:
Private Sub send_Click()'pengiriman dataOn Error Resume NextDim init As Integer For init = 1 To (Winsock1.Count - 1) If Winsock1(init).State = sckConnected Then Winsock1(init).SendData "Server : " & Text2.Text End If Text5 = "Server : " & Text2.Text & vbCrLf Next List2.AddItem "Server : " & Text2.TextEnd Sub
d. Command2 Kill client [command dibuat array]Source code :Saat di click:
Private Sub Command2_Click(Index As Integer)Dim a As StringOn Error Resume Nexta = intSckCnt'kill clientList1.AddItem "Client : " & intSckCnt & " Has Killed By Server"
Silent_System : Guide Back to The Right Track Halaman 8 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
MsgBox "Client " & intSckCntWinsock1(intSckCnt - 1).Tag = 0Winsock1(intSckCnt).CloseCommand2(Index).Enabled = FalseEnd Sub
Gambar Sebelum dan sesudah server dijalankan :
Saat Design
Silent_System : Guide Back to The Right Track Halaman 9 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
Saat Pertama Run
***********************Mendesain Client**************************Form Client :1. Form Lock Komputer
Form ini berfungsi untuk lock windows sebelum client login.Agar client tidak dapat menggunakan computer sebelum log in.
PropertiNo Property Value1 Caption log2 Height Sesuaikan3 Icon (Icon) disesuaikan4 Picture (Bitmap) disesuaikan5 WindowState Maximize6 Property lain Disesuaikan sesuai kebutuhan
Untuk lebih lanjut silahkan lihat gambar berikut :Gambar dibawah ini menunjukkan properties form log yang telah dibuat.Untuk properties dapat disesuaikan tergantung dari keinginan sang pembuat progam:
Silent_System : Guide Back to The Right Track Halaman 10 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
Tambahan Component Pada Form log: Button / Command
a. Button1 Menampilkan form login bagi user personal.Source code :Saat di click:Private Sub Button1_Click()'Menampilkan form login bagi personal (pengguna warnet)frmLogin.ShowEnd Sub
b. Button2 Menampilkan form login bagi user adminSource code :Saat di click:Private Sub Button2_Click()'Menampilkan form login bagi adminfrmLogin1.ShowEnd Sub
c. Button3 Menampilkan form HelpSource code :Saat di click:Private Sub Button3_Click()'Menampilkan form helphelp.ShowEnd Sub
Check Boxa. Check1 Sebagai Opsi kombinasi key yang di disable pada module2,begitu juga check
box yang lain .Kombinasi key yang didisable sesuai dengan caption / judul dari check Timer
a. tmrCloseTaskManager Menutup Task Manager Source code :
Private Sub tmrCloseTaskManager_Timer()'Disable Task ManagerwinHwnd = FindWindow(vbNullString, "Windows Task Manager")If winHwnd <> 0 ThenPostMessage winHwnd, WM_CLOSE, 0&, 0&ElseEnd IfEnd Sub
Modulea. Module1 Lock computer dan disable task manager.
Source code :
Option ExplicitGlobal Info
Global gGlobal allcharactersGlobal molestate()Type FILETIME lLowDateTime As Long lHighDateTime As LongEnd Type Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As LongDeclare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As LongDeclare Function RegCreateKey Lib "advapi32.dll" Alias
Silent_System : Guide Back to The Right Track Halaman 11 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
"RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As LongDeclare Function RegDeleteKey Lib "advapi32.dll" Alias "RegDeleteKeyA" (ByVal hKey As Long, ByVal lpSubKey As String) As LongDeclare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, ByVal lpData As String, lpcbData As Long) As LongDeclare Function RegQueryValueExA Lib "advapi32.dll" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, ByRef lpData As Long, lpcbData As Long) As LongDeclare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, ByVal lpData As String, ByVal cbData As Long) As LongDeclare Function RegSetValueExA Lib "advapi32.dll" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, ByRef lpData As Long, ByVal cbData As Long) As LongDeclare Function RegSetValueExB Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, ByRef lpData As Byte, ByVal cbData As Long) As Long
Const ERROR_SUCCESS = 0&Const ERROR_BADDB = 1009&Const ERROR_BADKEY = 1010&Const ERROR_CANTOPEN = 1011&Const ERROR_CANTREAD = 1012&Const ERROR_CANTWRITE = 1013&Const ERROR_OUTOFMEMORY = 14&Const ERROR_INVALID_PARAMETER = 87&Const ERROR_ACCESS_DENIED = 5&Const ERROR_NO_MORE_ITEMS = 259&Const ERROR_MORE_DATA = 234&
Const REG_NONE = 0&Const REG_SZ = 1&Const REG_EXPAND_SZ = 2&Const REG_BINARY = 3&Const REG_DWORD = 4&Const REG_DWORD_LITTLE_ENDIAN = 4&Const REG_DWORD_BIG_ENDIAN = 5&Const REG_LINK = 6&Const REG_MULTI_SZ = 7&Const REG_RESOURCE_LIST = 8&Const REG_FULL_RESOURCE_DESCRIPTOR = 9&Const REG_RESOURCE_REQUIREMENTS_LIST = 10&
Const KEY_QUERY_VALUE = &H1&Const KEY_SET_VALUE = &H2&Const KEY_CREATE_SUB_KEY = &H4&Const KEY_ENUMERATE_SUB_KEYS = &H8&Const KEY_NOTIFY = &H10&Const KEY_CREATE_LINK = &H20&Const READ_CONTROL = &H20000Const WRITE_DAC = &H40000Const WRITE_OWNER = &H80000Const SYNCHRONIZE = &H100000Const STANDARD_RIGHTS_REQUIRED = &HF0000Const STANDARD_RIGHTS_READ = READ_CONTROL
Silent_System : Guide Back to The Right Track Halaman 12 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
Const STANDARD_RIGHTS_WRITE = READ_CONTROLConst STANDARD_RIGHTS_EXECUTE = READ_CONTROLConst KEY_READ = STANDARD_RIGHTS_READ Or KEY_QUERY_VALUE Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFYConst KEY_WRITE = STANDARD_RIGHTS_WRITE Or KEY_SET_VALUE Or KEY_CREATE_SUB_KEYConst KEY_EXECUTE = KEY_READ
Dim hKey As Long, MainKeyHandle As LongDim rtn As Long, lBuffer As Long, sBuffer As StringDim lBufferSize As LongDim lDataSize As LongDim ByteArray() As Byte
Const DisplayErrorMsg = False
Function SetDWORDValue(SubKey As String, Entry As String, Value As Long)
Call ParseKey(SubKey, MainKeyHandle)
If MainKeyHandle Then rtn = RegOpenKeyEx(MainKeyHandle, SubKey, 0, KEY_WRITE, hKey) 'open the key If rtn = ERROR_SUCCESS Then rtn = RegSetValueExA(hKey, Entry, 0, REG_DWORD, Value, 4) If Not rtn = ERROR_SUCCESS Then If DisplayErrorMsg = True Then MsgBox ErrorMsg(rtn) End If End If rtn = RegCloseKey(hKey) 'Menutup key Else 'Jika ada error saat membuka key If DisplayErrorMsg = True Then 'Jika client ingin error ditampilkan MsgBox ErrorMsg(rtn) 'Menampilkan error End If End IfEnd If
End FunctionFunction GetDWORDValue(SubKey As String, Entry As String)
Call ParseKey(SubKey, MainKeyHandle)
If MainKeyHandle Then rtn = RegOpenKeyEx(MainKeyHandle, SubKey, 0, KEY_READ, hKey) 'Membuka key If rtn = ERROR_SUCCESS Then 'Jika key tidak bisa digunakan rtn = RegQueryValueExA(hKey, Entry, 0, REG_DWORD, lBuffer, 4) 'Mendapatkan value dari registry If rtn = ERROR_SUCCESS Then 'Jika value diterima kemudian rtn = RegCloseKey(hKey) 'Tutup key GetDWORDValue = lBuffer 'Ulangi value Else 'Sebaliknya, Jika value Tidak dapat diterima GetDWORDValue = "Error" 'Tampilkan Error pada user If DisplayErrorMsg = True Then 'Jika client ingin error ditampilkan MsgBox ErrorMsg(rtn) 'Menjelaskan pada user dad apa gerangan End If
Silent_System : Guide Back to The Right Track Halaman 13 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
End If Else 'Sebaliknya, jika key tidak bisa dibuka GetDWORDValue = "Error" 'Tampilkan Error pada user If DisplayErrorMsg = True Then 'Jika client ingin error ditampilkan MsgBox ErrorMsg(rtn) 'Menjelaskan pada user ada apa gerangan End If End IfEnd If
End Function
Function SetBinaryValue(SubKey As String, Entry As String, Value As String)Dim iCall ParseKey(SubKey, MainKeyHandle)
If MainKeyHandle Then rtn = RegOpenKeyEx(MainKeyHandle, SubKey, 0, KEY_WRITE, hKey) 'Membuka key If rtn = ERROR_SUCCESS Then 'Jika key dapat dibuka dengan sukses kemudian lDataSize = Len(Value) ReDim ByteArray(lDataSize) For i = 1 To lDataSize ByteArray(i) = Asc(Mid$(Value, i, 1)) Next rtn = RegSetValueExB(hKey, Entry, 0, REG_BINARY, ByteArray(1), lDataSize) 'Menulis value If Not rtn = ERROR_SUCCESS Then 'Jika ada error penulisan value If DisplayErrorMsg = True Then 'Jika client ingin error ditampilkan MsgBox ErrorMsg(rtn) 'Menampilkan error End If End If rtn = RegCloseKey(hKey) 'Menutup key Else 'Jika ada error saat membuka key If DisplayErrorMsg = True Then 'Jika user ingin error ditampilkan MsgBox ErrorMsg(rtn) 'Menampilkan error End If End IfEnd If
End Function
Function GetBinaryValue(SubKey As String, Entry As String)
Call ParseKey(SubKey, MainKeyHandle)
If MainKeyHandle Then rtn = RegOpenKeyEx(MainKeyHandle, SubKey, 0, KEY_READ, hKey) 'Membuka key If rtn = ERROR_SUCCESS Then 'Jika key tidak bisa dibuka lBufferSize = 1 rtn = RegQueryValueEx(hKey, Entry, 0, REG_BINARY, 0, lBufferSize) 'Mencari value dari registry sBuffer = Space(lBufferSize) rtn = RegQueryValueEx(hKey, Entry, 0, REG_BINARY, sBuffer, lBufferSize) 'Mencari value dari registry
Silent_System : Guide Back to The Right Track Halaman 14 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
If rtn = ERROR_SUCCESS Then 'Jika value ditemukan kemudian rtn = RegCloseKey(hKey) 'Menutup key GetBinaryValue = sBuffer 'Menampilkan value kepada user Else 'Sebaliknya, jika value tidak ditemukan GetBinaryValue = "Error" 'Pemberitahuan Error pada user If DisplayErrorMsg = True Then 'Jika user ingin error ditampilkan MsgBox ErrorMsg(rtn) 'Menampilkan error pada user End If End If Else ' 'Sebaliknya, jika key tidak bisa dibuka GetBinaryValue = "Error" 'Pemberitahuan Error pada user If DisplayErrorMsg = True Then 'Jika user ingin error ditampilkan MsgBox ErrorMsg(rtn) 'Menampilkan error pada user End If End IfEnd If
End FunctionFunction DeleteKey(KeyName As String)
Call ParseKey(KeyName, MainKeyHandle)
If MainKeyHandle Then rtn = RegOpenKeyEx(MainKeyHandle, KeyName, 0, KEY_WRITE, hKey) 'Membuka key If rtn = ERROR_SUCCESS Then 'Jika key tidak bisa dibuka rtn = RegDeleteKey(hKey, KeyName) 'Hapus key rtn = RegCloseKey(hKey) 'Tutup key End IfEnd If
End Function
Function GetMainKeyHandle(MainKeyName As String) As Long
Const HKEY_CLASSES_ROOT = &H80000000Const HKEY_CURRENT_USER = &H80000001Const HKEY_LOCAL_MACHINE = &H80000002Const HKEY_USERS = &H80000003Const HKEY_PERFORMANCE_DATA = &H80000004Const HKEY_CURRENT_CONFIG = &H80000005Const HKEY_DYN_DATA = &H80000006 Select Case MainKeyName Case "HKEY_CLASSES_ROOT" GetMainKeyHandle = HKEY_CLASSES_ROOT Case "HKEY_CURRENT_USER" GetMainKeyHandle = HKEY_CURRENT_USER Case "HKEY_LOCAL_MACHINE" GetMainKeyHandle = HKEY_LOCAL_MACHINE Case "HKEY_USERS" GetMainKeyHandle = HKEY_USERS Case "HKEY_PERFORMANCE_DATA" GetMainKeyHandle = HKEY_PERFORMANCE_DATA Case "HKEY_CURRENT_CONFIG" GetMainKeyHandle = HKEY_CURRENT_CONFIG Case "HKEY_DYN_DATA" GetMainKeyHandle = HKEY_DYN_DATAEnd Select
Silent_System : Guide Back to The Right Track Halaman 15 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
End Function
Function ErrorMsg(lErrorCode As Long) As String Dim GetErrorMsg'Jika error tidak akurat,dan user ingin pesan error ditampilkan ,kemudian'Tampilkan salahsatu dari pesan error yang ada
Select Case lErrorCode Case 1009, 1015 GetErrorMsg = "The Registry Database is corrupt!" Case 2, 1010 GetErrorMsg = "Bad Key Name" Case 1011 GetErrorMsg = "Can't Open Key" Case 4, 1012 GetErrorMsg = "Can't Read Key" Case 5 GetErrorMsg = "Access to this key is denied" Case 1013 GetErrorMsg = "Can't Write Key" Case 8, 14 GetErrorMsg = "Out of memory" Case 87 GetErrorMsg = "Invalid Parameter" Case 234 GetErrorMsg = "There is more data than the buffer has been allocated to hold." Case Else GetErrorMsg = "Undefined Error Code: " & Str$(lErrorCode)End Select
End Function
Function GetStringValue(SubKey As String, Entry As String)
Call ParseKey(SubKey, MainKeyHandle)
If MainKeyHandle Then rtn = RegOpenKeyEx(MainKeyHandle, SubKey, 0, KEY_READ, hKey) 'Membuka key If rtn = ERROR_SUCCESS Then 'Jika key bisa dibuka ,kemudian sBuffer = Space(255) 'buat penyimpan data lBufferSize = Len(sBuffer) rtn = RegQueryValueEx(hKey, Entry, 0, REG_SZ, sBuffer, lBufferSize) 'get the value from the registry If rtn = ERROR_SUCCESS Then 'jika value bisa dibuka kemudian rtn = RegCloseKey(hKey) 'menutup key sBuffer = Trim(sBuffer) GetStringValue = Left(sBuffer, Len(sBuffer) - 1) 'mengembalikan value pada user Else 'sebaliknya, jika value tidak bisa dibuka GetStringValue = "Error" 'menampilkan Error pada user (jangan hapus "Error" dan ubah menjadi "" karena ini dibutuhkan.) If DisplayErrorMsg = True Then 'jika user ingin error sitampilkan kemudian MsgBox ErrorMsg(rtn) 'menjelaskan pada user apa yang salah End If
Silent_System : Guide Back to The Right Track Halaman 16 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
End If Else 'sebaliknya, jika value tidak bisa dibuka GetStringValue = "Error" 'menampilkan Error pada user (jangan hapus "Error" dan ubah menjadi "" karena ini dibutuhkan.) If DisplayErrorMsg = True Then 'jika user ingin error ditampilkan kemudian MsgBox ErrorMsg(rtn) 'menjelaskan pada user apa yang salah End If End IfEnd If
End Function
Private Sub ParseKey(KeyName As String, Keyhandle As Long) rtn = InStr(KeyName, "\") 'kembali jika "\" yang dimasukkan dalam Keyname
If Left(KeyName, 5) <> "HKEY_" Or Right(KeyName, 1) = "\" Then 'if the is a "\" at the end of the Keyname then MsgBox "Incorrect Format:" + Chr(10) + Chr(10) + KeyName 'jika user ingin error ditampilkan kemudian Exit Sub 'exit the procedureElseIf rtn = 0 Then 'if the Keyname contains no "\" Keyhandle = GetMainKeyHandle(KeyName) KeyName = "" ' Keyname kosongElse 'sebaliknya, Keyname contains "\" Keyhandle = GetMainKeyHandle(Left(KeyName, rtn - 1)) 'memisahkan Keyname KeyName = Right(KeyName, Len(KeyName) - rtn)End If
End SubFunction CreateKey(SubKey As String)
Call ParseKey(SubKey, MainKeyHandle)
If MainKeyHandle Then rtn = RegCreateKey(MainKeyHandle, SubKey, hKey) 'membuat key If rtn = ERROR_SUCCESS Then 'jika key telah dibuat kemudian rtn = RegCloseKey(hKey) 'tutup key End IfEnd If
End FunctionFunction SetStringValue(SubKey As String, Entry As String, Value As String)
Call ParseKey(SubKey, MainKeyHandle)
If MainKeyHandle Then rtn = RegOpenKeyEx(MainKeyHandle, SubKey, 0, KEY_WRITE, hKey) 'membuka key If rtn = ERROR_SUCCESS Then 'jika key berhasil dibuka kemudian rtn = RegSetValueEx(hKey, Entry, 0, REG_SZ, ByVal Value, Len(Value)) 'menulis value If Not rtn = ERROR_SUCCESS Then 'jika terdapat error saat penulisan value If DisplayErrorMsg = True Then 'jika user ingin error ditampilkan kemudian MsgBox ErrorMsg(rtn) 'display error
Silent_System : Guide Back to The Right Track Halaman 17 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
End If End If rtn = RegCloseKey(hKey) 'menutup key Else 'jika key error sat dibuka If DisplayErrorMsg = True Then 'jika user ingin error ditampilkan kemudian MsgBox ErrorMsg(rtn) 'display error End If End IfEnd If
End Function
b. Module2 Disable kombinasi keySource code :
Option ExplicitPrivate mHook As LongPrivate Const WH_KEYBOARD_LL As Long = 13&
Private Type tagKBDLLHOOKSTRUCT vkCode As Long scanCode As Long flags As Long time As Long dwExtraInfo As LongEnd Type'pengesetan keyPrivate Const VK_TAB As Long = &H9Private Const VK_CONTROL As Long = &H11 ' pengesetan CtrlPrivate Const VK_MENU As Long = &H12 ' pengesetan AltPrivate Const VK_ESCAPE As Long = &H1BPrivate Const VK_DELETE As Long = &H2E ' pengesetan DelPrivate Const LLKHF_ALTDOWN As Long = &H20&Private Const VK_WINLOGO As Long = &H5B
Private Const HC_ACTION As Long = 0&
Private Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Long, ByVal lpfn As Long, ByVal hMod As Long, ByVal dwThreadId As Long) As LongPrivate Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As LongPrivate Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Long, ByVal nCode As Long, ByVal wParam As Long, ByVal lParam As Long) As LongPrivate Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As IntegerPrivate Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As LongPublic Function LLKeyBoardProc(ByVal nCode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long Dim pkbhs As tagKBDLLHOOKSTRUCT Dim ret As Long ret = 0 CopyMemory pkbhs, ByVal lParam, Len(pkbhs)
Silent_System : Guide Back to The Right Track Halaman 18 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
If nCode = HC_ACTION Then If log.Check2.Value = 1 Then 'jika check 2 aktif ,maka If pkbhs.vkCode = VK_ESCAPE Then If (GetAsyncKeyState(VK_CONTROL) And &H8000) Then ret = 1 End If End If End If If log.Check3.Value = 1 Then 'jika check 3 aktif ,maka If pkbhs.vkCode = VK_TAB Then If (pkbhs.flags And LLKHF_ALTDOWN) <> 0 Then ret = 1 End If End If End If If log.Check4.Value = 1 Then 'jika check 4 aktif ,maka If pkbhs.vkCode = VK_ESCAPE Then If (pkbhs.flags And LLKHF_ALTDOWN) <> 0 Then ret = 1 End If End If End If If log.Check1.Value = 1 Then 'jika check 1 aktif ,maka If pkbhs.vkCode = VK_WINLOGO Then ret = 1 End If End If End If If ret = 0 Then ret = CallNextHookEx(mHook, nCode, wParam, lParam) End If LLKeyBoardProc = retEnd Function
Public Sub HookKeyB(ByVal hMod As Long) mHook = SetWindowsHookEx(WH_KEYBOARD_LL, AddressOf LLKeyBoardProc, hMod, 0&)End Sub
Public Sub UnHookKeyB()'penutupan key If mHook <> 0 Then UnhookWindowsHookEx mHook End IfEnd Sub
2.Form Timer (Time Is Running Out) :Form ini berfungsi memonitor waktu,dan pengiriman atau penerimaan pesan
No Property Value1 Caption tiro
Silent_System : Guide Back to The Right Track Halaman 19 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
2 Height 27153 Icon (Icon) disesuaikan4 Picture (Bitmap) disesuaikan5 WindowState Normal6 Property lain Disesuaikan sesuai kebutuhan
Untuk lebih lanjut silahkan lihat gambar berikut :Gambar dibawah ini menunjukkan properties form log yang telah dibuat.Untuk properties dapat disesuaikan tergantung dari keinginan sang pembuat progam:
Tambahan Component Pada Form Tiro: Button / Command
a. Button1 Menampilkan username user personal.Source code : Saat form load :Button1.CaptionDown = frmLogin.txtUserName.TextButton1.CaptionOver = frmLogin.txtUserName.TextButton1.Caption = frmLogin.txtUserName.Text
b. Button2 Menampilkan time user saat login.Source code : Saat form load :X = time()Button2.CaptionDown = XButton2.CaptionOver = XButton2.Caption = X
c. Button3 Menampilkan time / jam.Source code : pada timer1 :
'set waktu pada button3.CaptionButton3.CaptionDown = time()
Silent_System : Guide Back to The Right Track Halaman 20 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
Button3.CaptionOver = time()Button3.Caption = time()
d. Button4 Menampilkan harga / biayaSource code : pada form load dan timer2 :Pada form load:Button4.Caption = "Rp " & 500Button4.CaptionDown = "Rp " & 500Button4.CaptionOver = "Rp " & 500
Pada timer2:Private Sub Timer2_Timer()'Penambahan price seiring berjalannya waktuButton4.Caption = "Rp " & Button4.Caption + 50Button4.CaptionDown = "Rp " & Button4.Caption + 50Button4.CaptionOver = "Rp " & Button4.Caption + 50End Sub
e. Button5 Menutup koneksi pada server.Source code : Saat di click :Private Sub Button5_Click()'pesan saat client hendak disconnectDim X As IntegerX = MsgBox("Are You Sure ?", 4 + 32, "Billing Nggleling")If X = 6 ThenWinsock1.SendData Button4.Caption 'Pengiriman data berupa caption pada button4MsgBox "Thank's For Used Me", 0 + 64, "Billing Nggleling"log.ShowWinExec "C:\WINDOWS\SYSTEM32\shutdown.exe -r -f -t 00", 0Else: MsgBox "Enjoy Your Net", 0 + 64, "Billing Nggleling"End IfEnd Sub
f. Button6 Menampilkan sarana untuk peniriman pesanSource code : Saat di click :Private Sub Button6_Click()'Setting object yang akan ditampilka/disembunyikanText1.Visible = TrueText2.Visible = TrueButton8.Visible = TrueButton9.Visible = TrueLabel2.Visible = TrueLabel1(4).Visible = Truetiro.Height = tiro.Height + 2850Button6.Visible = FalseEnd Sub
g. Button7 Melihat / mengetahui status winsockSource code : Pada timer1
'Melihat / mengetahui status winsockSelect Case Winsock1.State Case 0 Button7.Caption = "Status Connection : No Connection" Button7.CaptionDown = "Status Connection : No Connection" Button7.CaptionOver = "Status Connection : No Connection" Case 1 Button7.Caption = "Status Connection : Open Connection" Button7.CaptionDown = "Status Connection : Open Connection" Button7.CaptionOver = "Status Connection : Open Connection"
Silent_System : Guide Back to The Right Track Halaman 21 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
Case 2 Button7.Caption = "Status Connection : Listening" Button7.CaptionDown = "Status Connection : Listening" Button7.CaptionOver = "Status Connection : Listening" Case 3 Button7.Caption = "Status Connection : Connection Pending" Button7.CaptionDown = "Status Connection : Connection Pending" Button7.CaptionOver = "Status Connection : Connection Pending" Case 4 Button7.Caption = "Status Connection : Resolving Host" Button7.CaptionDown = "Status Connection : Resolving Host" Button7.CaptionOver = "Status Connection : Resolving Host" Case 5 Button7.Caption = "Status Connection : Host Resolved" Button7.CaptionDown = "Status Connection : Host Resolved" Button7.CaptionOver = "Status Connection : Host Resolved" Case 6 Button7.Caption = "Status Connection : Connecting" Button7.CaptionDown = "Status Connection : Connecting" Button7.CaptionOver = "Status Connection : Connecting" Case 7 Button7.Caption = "Status Connection : Connected" Button7.CaptionDown = "Status Connection : Connected" Button7.CaptionOver = "Status Connection : Connected" Case 8 Button7.Caption = "Status Connection : Peer is closing the Connection" Button7.CaptionDown = "Status Connection : Peer is closing the Connection" Button7.CaptionOver = "Status Connection : Peer is closing the Connection"
Case 9 Button7.Caption = "Status Connection : Error" Button7.CaptionDown = "Status Connection : Error" Button7.CaptionOver = "Status Connection : Error"End Select
h. Button8 Mengirim pesanSource code : saat di click
Private Sub Button8_Click()On Error GoTo t'Pengiriman dataWinsock1.SendData Text2.TextText1 = Text1 & "Client : " & Text2 & vbCrLfText2 = ""Exit Subt:MsgBox "Error : " & Err.DescriptionWinsock1_CloseEnd Sub
i. Button9 Menyembunyikan sarana untuk peniriman pesanSource code : Saat di click :
Private Sub Button9_Click()'Setting object yang akan ditampilka/disembunyikantiro.Height = tiro.Height - 2490 'Mengurangi tinggi formButton6.Visible = True 'Membuat VisibleText1.Visible = False 'Membuat invisibleText2.Visible = False 'Membuat invisibleButton8.Visible = False 'Membuat invisibleButton9.Visible = False 'Membuat invisibleLabel2.Visible = False 'Membuat invisible
Silent_System : Guide Back to The Right Track Halaman 22 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
Label1(4).Visible = False 'Membuat invisibleEnd Sub
Text Boxa. Text1 Menampilkan pesan yang diterima dandikirim.
Source code : Winsock1_DataArrivalPrivate Sub Winsock1_DataArrival(ByVal bytesTotal As Long)'pengambilan data saat data tibaDim strData As String Winsock1.GetData strData, vbString Text1 = Text1 & strData & vbCrLf'Memunculkan objectText2.Visible = TrueButton8.Visible = TrueButton9.Visible = TrueLabel2.Visible = TrueLabel1(4).Visible = TrueEnd Sub
b. Text2Sarana untuk memasukkan pesan yang akan dikirim. Timer
a. Timer1 Pengecekan status dan menampilkan time.Source code : Private Sub Timer1_Timer()'set waktu pada button3.CaptionButton3.CaptionDown = time()Button3.CaptionOver = time()Button3.Caption = time()'Melihat / mengetahui status winsockSelect Case Winsock1.State Case 0 Button7.Caption = "Status Connection : No Connection" Button7.CaptionDown = "Status Connection : No Connection" Button7.CaptionOver = "Status Connection : No Connection" Case 1 Button7.Caption = "Status Connection : Open Connection" Button7.CaptionDown = "Status Connection : Open Connection" Button7.CaptionOver = "Status Connection : Open Connection"
Case 2 Button7.Caption = "Status Connection : Listening" Button7.CaptionDown = "Status Connection : Listening" Button7.CaptionOver = "Status Connection : Listening" Case 3 Button7.Caption = "Status Connection : Connection Pending" Button7.CaptionDown = "Status Connection : Connection Pending" Button7.CaptionOver = "Status Connection : Connection Pending" Case 4 Button7.Caption = "Status Connection : Resolving Host" Button7.CaptionDown = "Status Connection : Resolving Host" Button7.CaptionOver = "Status Connection : Resolving Host" Case 5 Button7.Caption = "Status Connection : Host Resolved" Button7.CaptionDown = "Status Connection : Host Resolved" Button7.CaptionOver = "Status Connection : Host Resolved" Case 6 Button7.Caption = "Status Connection : Connecting" Button7.CaptionDown = "Status Connection : Connecting" Button7.CaptionOver = "Status Connection : Connecting" Case 7 Button7.Caption = "Status Connection : Connected" Button7.CaptionDown = "Status Connection : Connected" Button7.CaptionOver = "Status Connection : Connected"
Silent_System : Guide Back to The Right Track Halaman 23 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
Case 8 Button7.Caption = "Status Connection : Peer is closing the Connection" Button7.CaptionDown = "Status Connection : Peer is closing the Connection" Button7.CaptionOver = "Status Connection : Peer is closing the Connection"
Case 9 Button7.Caption = "Status Connection : Error" Button7.CaptionDown = "Status Connection : Error" Button7.CaptionOver = "Status Connection : Error"End Select'Mengubah Caption Saat Form MinimizedIf tiro.WindowState = 1 Thentiro.Caption = "Price : " & Button4.CaptionElse: tiro.Caption = "Billing Nggleling : Time Is Running Out"End IfIf Button7.Caption = "Status Connection : No Connection" Then log.ShowEnd Sub
b. Timer2 Membuat agar biaya terus bertambah seiring berjalanya waktuSource code:Private Sub Timer2_Timer()'Penambahan price seiring berjalannya waktuButton4.Caption = "Rp " & Button4.Caption + 50Button4.CaptionDown = "Rp " & Button4.Caption + 50Button4.CaptionOver = "Rp " & Button4.Caption + 50End Sub
Winsocka. Timer1 Membuat koneksi antar computer , panerima data ,dan pengirim data antar
computer.Source code:
Private Sub Winsock1_Close()'Menampilkan pesan saat koneksi winsock putusWinsock1.CloseText1 = Text1 & " :Disconnected"'Membuat item terlihatText1.Visible = TrueText2.Visible = TrueButton8.Visible = TrueButton9.Visible = TrueLabel2.Visible = TrueLabel1(4).Visible = TrueEnd Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)'pengambilan data saat data tibaDim strData As StringWinsock1.GetData strData, vbStringText1 = Text1 & strData & vbCrLf'Memunculkan objectText2.Visible = TrueButton8.Visible = TrueButton9.Visible = TrueLabel2.Visible = TrueLabel1(4).Visible = TrueEnd Sub
Private Sub Winsock1_Error(ByVal Number As Integer, Description As
Silent_System : Guide Back to The Right Track Halaman 24 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)'Menampilkan pesan saat winsock errorText1.Text = Text1 & "Error : " & DescriptionWinsock1_CloseText1.Visible = TrueText2.Visible = TrueButton8.Visible = TrueButton9.Visible = TrueLabel2.Visible = TrueLabel1(4).Visible = Truetiro.Height = tiro.Height + 2850End Sub
Menua. File
Message
Event : click
Akan muncul tools untuk melakukan pengiriman pesan
Source code:
Private Sub msgserver_Click()'Setting object yang akan ditampilka/disembunyikan dan menentukan tinggi formText1.Visible = TrueText2.Visible = TrueButton8.Visible = TrueButton9.Visible = TrueLabel2.Visible = TrueLabel1(4).Visible = Truetiro.Height = tiro.Height + 2850Button6.Visible = FalseEnd Sub
Calendar
Event : click
Menampilkan calendar saat billing digunakan
Source code:
Private Sub mncalendar_Click()'Menampilkan kalendercalendar.ShowEnd Sub
Disconnect
Event : click
Menutup koneksi ke server dan memunculkan form lock komputer
Source code:
Private Sub Dis_Click()'pesan saat client hendak disconnectDim X As IntegerX = MsgBox("Are You Sure ?", 4 + 32, "Billing Nggleling")
Silent_System : Guide Back to The Right Track Halaman 25 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
If X = 6 ThenWinsock1.SendData Button4.Caption 'Pengiriman data berupa caption pada button4MsgBox "Thank's For Used Me", 0 + 64, "Billing Nggleling"log.ShowWinExec "C:\WINDOWS\SYSTEM32\shutdown.exe -r -f -t 00", 0Else: MsgBox "Enjoy Your Net", 0 + 64, "Billing Nggleling"End IfEnd Sub
Show Time
Event : click
Menampilakan jam waktu setempat
Source code:
Private Sub showtm_Click()'menampilkan FormfrmClock.ShowEnd Sub
About
Event : click
Menampilkan form about
Source code:
Private Sub about_Click()'Menampilkan Form aboutfrmAbout.ShowEnd Sub
Show Price
Event : click
Menampilkan harga sesuai yang tertera pada label.
Source code:
Private Sub showprc_Click()'menampilkan pesan hargaMsgBox Button4.Caption, 0 + 64, "Billing Nggleling"End Sub
b. View
Internet Explorer
Event : click
Akan menjalankan progam web broser Internet Exporer (Iexporer.exe)
Source code:
Private Sub ie_Click()'Exsekusi applikasi internet explorer pada kondisi blank WinExec "c:\program files\internet explorer\iexplore.exe about:blank", 10End Sub
Mozilla
Event : click
Akan menjalankan progam web broser Mozilla(mozilla.exe)
Silent_System : Guide Back to The Right Track Halaman 26 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
Source code:
Private Sub mz_Click()
'Eksekusi application mozilla dengan kondisi blank
On Error GoTo msg
WinExec "c:\program files\mozila\mozila.exe about:blank", 10
msg:
MsgBox "Mozilla not Installed"
End Sub
Yahoo
Event : click
Menjalankan progam web broser Internet Exporer dengan URL otomatis http://yahoo.com
Source code:
Private Sub yahoo_Click()
'Eksekusi application internet explorer dengan langsung membuka http:yahoo.com
WinExec "c:\program files\internet explorer\iexplore.exe http://www.yahoo.com", 10
End Sub
Event : click
Menjalankan progam web broser Internet Exporer dengan URL otomatis http://google.com atau http://google.co.id
Source code:
Private Sub google_Click()
'Eksekusi application internet explorer dengan langsung membuka http:google.com
WinExec "c:\program files\internet explorer\iexplore.exe http://www.google.com", 10
End Sub
c. Help
Message
Event : click
Dengan message diharapkan clien yang mengalami kesulitan dapat mengirimkan pesan kepada server.
Source code:
Private Sub sendmsg_Click()
'Setting object yang akan ditampilka/disembunyikan
Text1.Visible = True
Text2.Visible = True
Button8.Visible = True
Silent_System : Guide Back to The Right Track Halaman 27 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
Button9.Visible = True
Label2.Visible = True
Label1(4).Visible = True
tiro.Height = tiro.Height + 2850
Button6.Visible = False
End Sub
About
Event : click
Menampilkan tentang pembuat progam
Source code:
Private Sub mnabout_Click()
'Menampilkan Form About
frmAbout.Show
End Sub
Source Code lengkap :
'Deklarasi file eksekutor
Private Declare Function WinExec Lib "kernel32" (ByVal lpCmdLine As String, ByVal nCmdShow As Long) As Long
Private Sub about_Click()
'Menampilkan Form about
frmAbout.Show
End Sub
Private Sub Button5_Click()
'pesan saat client hendak disconnect
Dim X As Integer
X = MsgBox("Are You Sure ?", 4 + 32, "Billing Nggleling")
If X = 6 Then
Winsock1.SendData Button4.Caption 'Pengiriman data berupa caption pada button4
MsgBox "Thank's For Used Me", 0 + 64, "Billing Nggleling"
log.Show
WinExec "C:\WINDOWS\SYSTEM32\shutdown.exe -r -f -t 00", 0
Else: MsgBox "Enjoy Your Net", 0 + 64, "Billing Nggleling"
End If
End Sub
Private Sub Button6_Click()
'Setting object yang akan ditampilka/disembunyikan
Text1.Visible = True
Text2.Visible = True
Silent_System : Guide Back to The Right Track Halaman 28 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
Button8.Visible = True
Button9.Visible = True
Label2.Visible = True
Label1(4).Visible = True
tiro.Height = tiro.Height + 2850
Button6.Visible = False
End Sub
Private Sub Button8_Click()
On Error GoTo t
'Pengiriman data
Winsock1.SendData Text2.Text
Text1 = Text1 & "Client : " & Text2 & vbCrLf
Text2 = ""
Exit Sub
t:
MsgBox "Error : " & Err.Description
Winsock1_Close
End Sub
Private Sub Button9_Click()
'Setting object yang akan ditampilka/disembunyikan
tiro.Height = tiro.Height - 2490 'Mengurangi tinggi form
Button6.Visible = True 'Membuat Visible
Text1.Visible = False 'Membuat invisible
Text2.Visible = False 'Membuat invisible
Button8.Visible = False 'Membuat invisible
Button9.Visible = False 'Membuat invisible
Label2.Visible = False 'Membuat invisible
Label1(4).Visible = False 'Membuat invisible
End Sub
Private Sub Dis_Click()
'Pesan saat client hendak disconnect
Dim X As Integer
X = MsgBox("Are You Sure ?", 4 + 32, "Billing Nggleling")
If X = 6 Then
Winsock1.SendData Button4.Caption 'Pengiriman data berupa caption pada button4
MsgBox "Thank's For Used Me", 0 + 64, "Billing Nggleling"
log.Show
Else: MsgBox "Enjoy Your Net", 0 + 64, "Billing Nggleling"
Silent_System : Guide Back to The Right Track Halaman 29 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
End If
End Sub
Private Sub Form_Load()
'Menutup Form Log
Unload log
'Membuka koneksi winsock
Winsock1.RemoteHost = "127.0.0.1"
Winsock1.RemotePort = 1000
Winsock1.Connect
Button7.Caption = Winsock1.State
Button7.CaptionDown = Winsock1.State
Button7.CaptionOver = Winsock1.State
Button1.CaptionDown = frmLogin.txtUserName.Text
Button1.CaptionOver = frmLogin.txtUserName.Text
Button1.Caption = frmLogin.txtUserName.Text
Timer1.Interval = 1000
'mengambil waktu saat client log in
X = time()
Button2.CaptionDown = X
Button2.CaptionOver = X
Button2.Caption = X
Button4.Caption = "Rp " & 500
Button4.CaptionDown = "Rp " & 500
Button4.CaptionOver = "Rp " & 500
'Setting interval timer
Timer2.Interval = 60000
'invisible object saat form load
Text1.Visible = False
Text2.Visible = False
Text3.Visible = False
Button8.Visible = False
Button9.Visible = False
Label2.Visible = False
Label1(4).Visible = False
Silent_System : Guide Back to The Right Track Halaman 30 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
'Saat diklik [X]:Close button ,tidak menutup namun minimized
Cancel = 1
tiro.WindowState = 1
End Sub
Private Sub Form_Unload(Cancel As Integer)
Winsock1.Close
End Sub
Private Sub google_Click()
'Eksekusi application internet explorer dengan langsung membuka http:google.com
WinExec "c:\program files\internet explorer\iexplore.exe http://www.google.com", 10
End Sub
Private Sub ie_Click()
'Exsekusi applikasi internet explorer pada kondisi blank
WinExec "c:\program files\internet explorer\iexplore.exe about:blank", 10
End Sub
Private Sub mnabout_Click()
'Menampilkan Form About
frmAbout.Show
End Sub
Private Sub mncalendar_Click()
'Menampilkan kalender
calendar.Show
End Sub
Private Sub msgclient_Click()
'Setting object yang akan ditampilka/disembunyikan dan menentukan tinggi form
Text1.Visible = True
Button8.Visible = True
Button9.Visible = True
Label2.Visible = True
Label1(4).Visible = True
Silent_System : Guide Back to The Right Track Halaman 31 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
tiro.Height = tiro.Height + 2850
Button6.Visible = False
End Sub
Private Sub msgserver_Click()
'Setting object yang akan ditampilka/disembunyikan dan menentukan tinggi form
Text1.Visible = True
Text2.Visible = True
Button8.Visible = True
Button9.Visible = True
Label2.Visible = True
Label1(4).Visible = True
tiro.Height = tiro.Height + 2850
Button6.Visible = False
End Sub
Private Sub mz_Click()
'Eksekusi application mozilla dengan kondisi blank
On Error GoTo msg
WinExec "c:\program files\mozila\mozila.exe about:blank", 10
msg:
MsgBox "Mozilla not Installed"
End Sub
Private Sub sendmsg_Click()
'Mengirim pesan
'Setting object yang akan ditampilka/disembunyikan dan menentukan tinggi form
Text1.Visible = True
Text2.Visible = True
Button8.Visible = True
Button9.Visible = True
Label2.Visible = True
Label1(4).Visible = True
tiro.Height = tiro.Height + 2850
Button6.Visible = False
End Sub
Private Sub showprc_Click()
'menampilkan pesan harga
MsgBox Button4.Caption, 0 + 64, "Billing Nggleling"
End Sub
Silent_System : Guide Back to The Right Track Halaman 32 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
Private Sub showtm_Click()
'menampilkan Form
frmClock.Show
End Sub
Private Sub Text2_Click()
'Menghilangkan text
Text2.Text = ""
End Sub
Private Sub Timer1_Timer()
'set waktu pada button3.Caption
Button3.CaptionDown = time()
Button3.CaptionOver = time()
Button3.Caption = time()
'Melihat / mengetahui status winsock
Select Case Winsock1.State
Case 0
Button7.Caption = "Status Connection : No Connection"
Button7.CaptionDown = "Status Connection : No Connection"
Button7.CaptionOver = "Status Connection : No Connection"
Case 1
Button7.Caption = "Status Connection : Open Connection"
Button7.CaptionDown = "Status Connection : Open Connection"
Button7.CaptionOver = "Status Connection : Open Connection"
Case 2
Button7.Caption = "Status Connection : Listening"
Button7.CaptionDown = "Status Connection : Listening"
Button7.CaptionOver = "Status Connection : Listening"
Case 3
Button7.Caption = "Status Connection : Connection Pending"
Button7.CaptionDown = "Status Connection : Connection Pending"
Button7.CaptionOver = "Status Connection : Connection Pending"
Case 4
Button7.Caption = "Status Connection : Resolving Host"
Button7.CaptionDown = "Status Connection : Resolving Host"
Button7.CaptionOver = "Status Connection : Resolving Host"
Case 5
Button7.Caption = "Status Connection : Host Resolved"
Silent_System : Guide Back to The Right Track Halaman 33 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
Button7.CaptionDown = "Status Connection : Host Resolved"
Button7.CaptionOver = "Status Connection : Host Resolved"
Case 6
Button7.Caption = "Status Connection : Connecting"
Button7.CaptionDown = "Status Connection : Connecting"
Button7.CaptionOver = "Status Connection : Connecting"
Case 7
Button7.Caption = "Status Connection : Connected"
Button7.CaptionDown = "Status Connection : Connected"
Button7.CaptionOver = "Status Connection : Connected"
Case 8
Button7.Caption = "Status Connection : Peer is closing the Connection"
Button7.CaptionDown = "Status Connection : Peer is closing the Connection"
Button7.CaptionOver = "Status Connection : Peer is closing the Connection"
Case 9
Button7.Caption = "Status Connection : Error"
Button7.CaptionDown = "Status Connection : Error"
Button7.CaptionOver = "Status Connection : Error"
End Select
'Mengubah Caption Saat Form Minimized
If tiro.WindowState = 1 Then
tiro.Caption = "Price : " & Button4.Caption
Else: tiro.Caption = "Billing Nggleling : Time Is Running Out"
End If
If Button7.Caption = "Status Connection : No Connection" Then log.Show
End Sub
Private Sub Timer2_Timer()
'Penambahan price seiring berjalannya waktu
Button4.Caption = "Rp " & Button4.Caption + 50
Button4.CaptionDown = "Rp " & Button4.Caption + 50
Button4.CaptionOver = "Rp " & Button4.Caption + 50
End Sub
Private Sub Winsock1_Close()
Silent_System : Guide Back to The Right Track Halaman 34 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
'Menampilkan pesan saat koneksi winsock putus
Winsock1.Close
Text1 = Text1 & " :Disconnected"
'Membuat item terlihat
Text1.Visible = True
Text2.Visible = True
Button8.Visible = True
Button9.Visible = True
Label2.Visible = True
Label1(4).Visible = True
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
'pengambilan data saat data tiba
Dim strData As String
Winsock1.GetData strData, vbString
Text1 = Text1 & strData & vbCrLf
'Memunculkan object
Text2.Visible = True
Button8.Visible = True
Button9.Visible = True
Label2.Visible = True
Label1(4).Visible = True
End Sub
Private Sub Winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
'Menampilkan pesan saat winsock error
Text1.Text = Text1 & "Error : " & Description
Winsock1_Close
Text1.Visible = True
Text2.Visible = True
Button8.Visible = True
Button9.Visible = True
Label2.Visible = True
Label1(4).Visible = True
tiro.Height = tiro.Height + 2850
End Sub
Private Sub yahoo_Click()
Silent_System : Guide Back to The Right Track Halaman 35 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
'Eksekusi application internet explorer dengan langsung membuka http:yahoo.com
WinExec "c:\program files\internet explorer\iexplore.exe http://www.yahoo.com", 10
End Sub
Gambar Sebelum dan sesudah Tiro dijalankan :
3.Form Login untuk client:Saat client hendak login maka diharuskan mengisi username.No Property Value1 Caption frmlogin2 Border Style Fixed Dialog3 Icon (Icon) disesuaikan4 Picture (Bitmap) disesuaikan5 WindowState Normal6 Property lain Disesuaikan sesuai kebutuhan
Tambahan Component Pada Form Login: Text Box
a. Text1 Tempat memasukkan username Button
a. Button1 Menutup log dan menampilkan form tiroSource code:Private Sub Button1_Click()
If txtUserName = "" Then
MsgBox "Insert Your User Name"
frmLogin.Show
Else:
tiro.Show
Unload log
Unload Me
UnHookKeyB
End If
End Sub
b. Button1 CancelSource code:Private Sub Button2_Click()
Silent_System : Guide Back to The Right Track Halaman 36 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
Unload Me
End Sub
Source Code lengkap :
Option Explicit
Private Sub Button1_Click()
If txtUserName = "" Then
MsgBox "Insert Your User Name"
frmLogin.Show
Else:
tiro.Show
Unload log
Unload Me
UnHookKeyB
End If
End Sub
Private Sub Button2_Click()
Unload Me
End Sub
Private Sub Form_Load()
End Sub
5.Form Login untuk Server:Sebelum login admin diminta memasukksn username dan password.No Property Value1 Caption frmlogin12 Border Style Fixed Dialog3 Icon (Icon) disesuaikan4 Picture (Bitmap) disesuaikan5 WindowState Normal6 Property lain Disesuaikan sesuai kebutuhan
Tambahan Component Pada Form Login: Text Box
a. Text1 Tempat memasukkan usernameb. Text2 Tempat memasukkan passwordc.
Buttonc. Button1 Menutup log
Source code:Private Sub cmdOK_Click()
'Cek kebenaran password
Silent_System : Guide Back to The Right Track Halaman 37 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
If txtPassword = ("password") And txtUserName.Text = ("admin") Then
LoginSucceeded = True
Unload Me
Unload log
UnHookKeyB
Else
MsgBox "Invalid Password, try again!", , "Login"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
End If
UnHookKeyB
End Sub
d. Button1 CancelSource code:Private Sub cmdCancel_Click()
LoginSucceeded = False
Me.Hide
End Sub
Source Code lengkap :
Option Explicit
Public LoginSucceeded As Boolean
Private Sub cmdCancel_Click()
LoginSucceeded = False
Me.Hide
End Sub
Private Sub cmdOK_Click()
'Cek kebenaran password
If txtPassword = ("password") And txtUserName.Text = ("admin") Then
LoginSucceeded = True
Unload Me
Unload log
UnHookKeyB
Else
MsgBox "Invalid Password, try again!", , "Login"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
End If
Silent_System : Guide Back to The Right Track Halaman 38 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
UnHookKeyB
End Sub
6.Form Clock:Menampilkan jam:No Property Value1 Caption frmClock2 Border Style Sizable3 Icon (Icon) disesuaikan4 Picture (Bitmap) disesuaikan5 WindowState Normal6 Property lain Disesuaikan sesuai kebutuhan
Tambahan Component Pada Form Login: Image [ 6 buah ] : Menampilkan gambar Label [ 1 buah = lbldate ] : Menampilkan hari dan tanggal ImageList [ 1 buah ] : Mengurutkan gambar
Source Code lengkap :
Private Declare Sub SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)Const HWND_TOPMOST = -1Const SWP_NOACTIVATE = &H10Const SWP_SHOWWINDOW = &H40
Private Sub Form_Load()lblDate.Caption = time & " - " & Format(Date, "Long Date")
SetWindowPos hwnd, HWND_TOPMOST, Left / 15, Top / 15, Width / 15, Height / 15, SWP_NOACTIVATE Or SWP_SHOWWINDOW
timTime.Interval = (1 - (Int(Timer) Mod 1)) * 1000End SubPrivate Sub timTime_Timer()On Error GoTo ErorDim t As String, H1 As Integer, H2 As Integer, M1 As Integer, M2 As Integer, S1 As Integer, S2 As Integer
t = time
If Len(time) = 10 Then t = 0 & t
t = Replace(t, ":", "")t = Replace(t, " ", "")lblAMPM.Caption = Right(t, 2)t = Replace(t, "PM", "")t = Replace(t, "AM", "")
H1 = Mid(t, 1, 1)H2 = Mid(t, 2, 1)M1 = Mid(t, 3, 1)M2 = Mid(t, 4, 1)S1 = Mid(t, 5, 1)
Silent_System : Guide Back to The Right Track Halaman 39 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
S2 = Mid(t, 6, 1)
ClockSet Hour1, H1ClockSet Hour2, H2ClockSet Min1, M1ClockSet Min2, M2ClockSet Sec1, S1ClockSet Sec2, S2lblDate.Caption = Format(Date, "Long Date")
Exit SubEror:If Err = 13 Then MsgBox "This program will only work if you set 'Start, Settings, Control Panel, Regional Settings, Time, Time separator:' to ':' (colon).", 16, "Error"Unload frmClockEnd Sub
Sub ClockSet(Img As Image, Number As Integer)If Number = 0 Then Number = 10Img.Picture = ImgNum.ListImages.Item(Number).PictureEnd Sub
1. Menguji Produk (PC Media edisi 10/2006 hal.87 “Seluk Beluk Testing Aplikasi”) Referensi From Nugie
Menguji produk bisa dikatakan juga dengan testing aplikasi. Testing aplikasi merupakan suatu kegiatan untuk mengidentifikasi keberhasilan, kelengkapan, keamanan, dan kualitas pada aplikasi yang bersangkutan.
Beberapa istilah kesalahan ketika program aplikasi berjalan :
a. Crash
Yaitu saat sistem mengalami gangguan secara tiba-tiba. Aplikasi dapat menutup dengan sendirinya, atau bahkan dapat menyebabkan hang pada komputer yang mengharuskan Anda untuk melakukan restart. Crash tidak selalu berasal dari bug aplikasi, crash dapat berasal dari permasalahan hardware, operating system, ataupun software lainnya. Tetapi, bug aplikasi dapat saja menyebabkan crash.
b. Anomaly
Yaitu saat sebuah aplikasi menghasilkan sesuatu yang ganjil dan menyimpang dari dokumentasi operasional aplikasi tersebut. Hal ini bukan merupakan bug jika fungsi aplikasi berjalan dengan baik, hanya saja tidak dibuat sesuai dengan dokumentasi.
c. Fault
Yaitu kesalahan yang terjadi karena kesalahan urutan langkah, proses, atau definisi data sehingga menyebabkan program melakukan proses yang tidak diantisipasi. Kesalahan ini dapat disebabkan karena kesalahan melakukan prosedur aplikasi.
d. Mistake
Yaitu kegiatan yang dilakukan user sehingga menyebabkan aplikasi mengeluarkan hasil yang salah.
Berikut dua panduan utama untuk melakukan proses testing:
1. Memeriksa bahwa aplikasi berfungsi sebagaimana mestinya.
Silent_System : Guide Back to The Right Track Halaman 40 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
2. Jika bug ditemukan dan telah diperbaiki, pastikan bahwa bagian-bagian lain dari aplikasi (walaupun tampaknya tidak berhubungan dengan bug tersebut) masih berjalan dengan baik.
Beberapa tahapan testing yang umum dilalui oleh aplikasi:
1. Unit/Component Testing
Unit testing merupakan proses testing, dimana testing dilakukan pad bagian basic dari kode program. Contohnya : memeriksa kode program pada event, procedure, dan function.
Component testing meliputi testing pada fungsi-fungsi yang lebih kompleks yang tercakup menjadi suatu komponen.
2. Integration Testing
Testing ini memeriksa bagaimana unit-unit yang telah melalui Unit/Component Testing bekerja sebagai suatu kombinasi, bukan lagi sebagai suatu unit yang individual.
3. System Testing
Mencakup testing aplikasi yang telah selesai didevelop. Karena itu, aplikasi harus terlihat dan berfungsi sebagaimana mestinya terhadap end-user. Untuk itu, testing dilakukan dengan menggunakan data yang menggambarkan data yang dipergunakan oleh pengguna sesungguhnya terhadap aplikasi.
4. Acceptance Testing
Testing ini sama seperti Integration Testing dan Acceptance Testing. Perbedaanya hanya siapa yang melakukan testing. Pada tahap ini, end-user yang terpilih melakukan testing terhadap fungsi-fungsi aplikasi dan melaporkan permasalahan yang ditemukan. Proses ini merupakan salah satu tahap final sebelum pengguna menyetujui dan menerima penerapan sistem aplikasi yang baru.
5. Regression Testing
Ini merupakan bagian terpenting dari semua testing di atas. Testing ini mencakup pengujian ulang terhadap unit, component, proses, atau keseluruhan aplikasi setelah perbaikan suatu kesalahan dilakukan. Ini untuk memastikan permasalahan yang terjadi telah ditanggulangi dan tidak muncul masalah baru yang timbul dari efek perbaikan kesalahan sebelumnya.
2. Mengemas Produk (Packing)
Sebagai seorang programmer sekaligus sebagai software development, kita harus memperkenalkan (menjual) produk yang telah kita buat ke pengguna akhir (end-user). Akan tetapi untuk mendistribusikan produk tersebut tidaklah mudah. File yang kita distribusikan bukan hanya file executable saja, akan tetapi harus menyertakan file-file pendukung, seperti file library (dll), gambar (kalau ada), dokumentasi, dan manual. Kita juga harus memperhatikan hal-hal berikut ini:
a. Perbedaan spesifikasi komputer
b. Kompabilitas produk yang kita buat dengan operating system end-user
c. File-file yang (mungkin) dibutuhkan dalam program aplikasi kita.
Oleh karena itulah, kita harus mengemas (packing) produk kita. Keuntungan kita melakukan packing adalah kita tidak harus repot-repot mencari, meng-copy, lalu menyertakannya dalam produk kita. Contohnya dalam Microsoft Visual Basic 6.0 sudah disediakan tool untuk mem-package project yang kita buat, yaitu Package & Deployment Wizard. Tool ini sangat memudahkan kita untuk mem-packing produk yang telah kita buat.
Berikut ini langkah-langkah untuk mem-package project (produk) kita:
Silent_System : Guide Back to The Right Track Halaman 41 dari 42
Hypersoft Silent_SystemTugas Akhir Billing Nggleling 1.0
Kita jalankan tool package Visual Basic 6.0, klik Start -> All Programs -> Microsoft Visual Basic 6.0 -> Microsoft Visual Basic 6.0 Tools. Lalu pilih Package & Deployment Wizard.
My AvatarName Candra Aditama
Address Sanggrahan,Murtigading,Sanden,Bantul,Yogyakarta
School SMK N 2 Depok
Company Hypersoft Silemt_System.Inc
E-mail [email protected]
Silent_System : Guide Back to The Right Track Halaman 42 dari 42