Penulis Topik: [Share Source code VB6] About Antivirus  (Dibaca 45872 kali)

Offline NullByte

  • Pro3
  • **
  • Tulisan: 3
  • Reputation: 37
    • Lihat Profil
Re: [Share Source code VB6] About Antivirus
« Jawab #10 pada: Juni 07, 2014, 04:34:21 AM »
Gan share dong SC Antivirus terbaru klo bsa pake dirtree.

Offline VianDwiCyber

  • Pro1
  • *
  • Tulisan: 2
  • Reputation: 34
    • Lihat Profil
Re: [Share Source code VB6] About Antivirus
« Jawab #11 pada: Juli 28, 2015, 03:01:56 PM »
Download .ocx nya dulu di = http://www.4shared.com/rar/Q-_FG1qcba/SMKDirtreeV2__Black_.html

buat satu form, dengan bahan bahan :
1 command button dengan name : "Scan" dengan code :
Private Sub scan_Click()
 Dim lstCek      As Collection
Set lstCek = New Collection
Dim iCount As Integer
Dim i As Integer
DirTree1.OutPutPath lstCek
List1.Clear
   For iCount = 1 To lstCek.Count
   List1.AddItem lstCek(iCount)
   Next

    If scan.Caption = "Scan" Then
        scan.Caption = "Stop"
        For i = 1 To lstCek.Count
        Pindai lstCek(i)
        Next
        scan.Caption = "Scan"
    Else
        scan.Caption = "Scan"
    End If
End Sub



1 Smkdirtree dari .ocx tadi yang kita download engan nama "DirTree1"
1 buah listbox dengan nama "List1"
1 buah textbox dengan nama "text2"
1 buah label dengan nama "Label2"

buat satu module dengan nama "ModScan: dengan code :

 Option Explicit
Dim Total_size As Double
Public jumlah_file, JumDir As Single
Public Hasil, Addres As String

Declare Function GetLogicalDrives Lib "kernel32" () As Long

Private Declare Function FindFirstFile Lib "kernel32" Alias _
"FindFirstFileA" (ByVal lpFileName As String, lpFindFileData _
As WIN32_FIND_DATA) As Long
Private Declare Function FindNextFile Lib "kernel32" Alias _
"FindNextFileA" (ByVal hFindFile As Long, lpFindFileData As _
WIN32_FIND_DATA) As Long
Private Declare Function GetFileAttributes Lib "kernel32" _
Alias "GetFileAttributesA" (ByVal lpFileName As String) As Long
Private Declare Function FindClose Lib "kernel32" _
(ByVal hFindFile As Long) As Long
Private Declare Function GetSystemDirectory Lib "kernel32" _
Alias "GetSystemDirectoryA" _
(ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Declare Function GetWindowsDirectory Lib "kernel32" _
Alias "GetWindowsDirectoryA" _
(ByVal lpBuffer As String, ByVal nSize As Long) As Long

Const MAX_PATH = 260
Const MAXDWORD = &HFFFF
Const INVALID_HANDLE_VALUE = -1
Const FILE_ATTRIBUTE_ARCHIVE = &H20
Const FILE_ATTRIBUTE_DIRECTORY = &H10
Const FILE_ATTRIBUTE_HIDDEN = &H2
Const FILE_ATTRIBUTE_NORMAL = &H80
Const FILE_ATTRIBUTE_READONLY = &H1
Const FILE_ATTRIBUTE_SYSTEM = &H4
Const FILE_ATTRIBUTE_TEMPORARY = &H100

Private Type FILETIME
    dwLowDateTime As Long
    dwHighDateTime As Long
End Type

Private Type WIN32_FIND_DATA
    dwFileAttributes As Long
    ftCreationTime As FILETIME
    ftLastAccessTime As FILETIME
    ftLastWriteTime As FILETIME
    nFileSizeHigh As Long
    nFileSizeLow As Long
    dwReserved0 As Long
    dwReserved1 As Long
    cFileName As String * MAX_PATH
    cAlternate As String * 14
End Type
Function StripNulls(OriginalStr As String) As String
    If (InStr(OriginalStr, Chr(0)) > 0) Then
        OriginalStr = Left(OriginalStr, InStr(OriginalStr, Chr(0)) - 1)
    End If
    StripNulls = OriginalStr
End Function

Function Pindai(Path As String)
    Dim Filename As String
    Dim DirName As String
    Dim dirNames() As String
    Dim nDir As Integer
    Dim i As Integer
    Dim hSearch As Long
    Dim WFD As WIN32_FIND_DATA
    Dim Cont As Integer
    On Error Resume Next
    If Form1.scan.Caption = "Scan" Then Exit Function
    If Right(Path, 1) <> "\" Then Path = Path & "\"
    nDir = 0
    ReDim dirNames(nDir)
    Cont = True
    hSearch = FindFirstFile(Path & "*", WFD)
    If hSearch <> INVALID_HANDLE_VALUE Then
        Do While Cont
        DirName = StripNulls(WFD.cFileName)
        If (DirName <> ".") And (DirName <> "..") Then
            If GetFileAttributes(Path & DirName) And _
            FILE_ATTRIBUTE_DIRECTORY Then
                dirNames(nDir) = DirName
                nDir = nDir + 1
                JumDir = JumDir + 1
                ReDim Preserve dirNames(nDir)
            End If
        End If
        Cont = FindNextFile(hSearch, WFD) 'Get next subdirectory.
        DoEvents
        Loop
        Cont = FindClose(hSearch)
    End If
    hSearch = FindFirstFile(Path & "*.*", WFD)
    Cont = True
    If hSearch <> INVALID_HANDLE_VALUE Then
        While Cont And Form1.scan.Caption = "Stop"
            Filename = StripNulls(WFD.cFileName)
            If (Filename <> ".") And (Filename <> "..") Then
                'perhatikan pada code daerah ini [ penting ]
                Pindai = Pindai + (WFD.nFileSizeHigh * MAXDWORD) + WFD.nFileSizeLow
                jumlah_file = jumlah_file + 1
                Form1.Text2.Text = Path & Filename
                Addres = Path & Filename
                Total_size = Total_size + FileLen(Path & Filename)
                Form1.Label2.Caption = jumlah_file
                ' taruh aksi-aksi diatas z
            End If
            Cont = FindNextFile(hSearch, WFD) ' Get next file
            DoEvents
        Wend
        Cont = FindClose(hSearch)
    End If
    If nDir > 0 Then
        For i = 0 To nDir - 1
            Pindai = Pindai + Pindai(Path & dirNames(i) & "\")
            DoEvents
        Next i
    End If
End Function

Function WinDir() As String
    Dim sSave As String, Ret As Long
    sSave = Space(255)
    Ret = GetWindowsDirectory(sSave, 255)
    WinDir = Left$(sSave, Ret)
End Function

lalu jalankan aplikasi nya, silahkan di kembangin ajha ...