Jumat, 25 Juni 2010

Anti virus sederhana



ni sampel anti virus sederhana vb6, tolong dikembangkan.....
(ni hasil googling jg.... :) )

Private Sub Command1_Click()
On Error Resume Next
Dim SearchPath As String, FindStr As String
Dim FileSize As Long
Dim NumFiles As Integer, NumDirs As Integer

List1.Clear
'Label1.Caption = ""

st = "Cari"

Label1.Caption = "0"
'If Mid(Dir1.path, 2, 2) = ":\\" Then
'AmbilPt = Mid(Dir1.path, 1, 3)
'Else
'End If
SearchPath = Dir1.path & "\"
FindStr = "*.*"
FileSize = FindFiles(SearchPath, FindStr, NumFiles, NumDirs)
End Sub

Private Sub Command2_Click()
st = "Stop"
End Sub
Sub pouse(angka)
Dim pos As Integer
Dim tm As Timer
tm1 = Timer
Do
If Timer - tm1 >= angka Then
Exit Sub
Else
pos% = DoEvents()
End If
Loop
End Sub


Private Sub Command3_Click()
On Error Resume Next
Dim NumPath As String
Dim Temp As String
Set fl = New FileSystemObject
Set pt = New FileSystemObject
Set fldr = New FileSystemObject
Set ver = New FileSystemObject
Set Temp12 = New FileSystemObject
cm.ShowOpen
NumPath = cm.FileName

lblname.Caption = ver.GetFileName(cm.FileName)
lblversion.Caption = ver.GetFileVersion(cm.FileName)
lblinternal.Caption = ver.GetBaseName(cm.FileName)
lbllanguage.Caption = ver.GetTempName '(cm.FileName)
lblori.Caption = ver.GetDriveName(cm.FileName)
lblproduct.Text = ver.GetFile(cm.FileName)

End Sub

Private Sub Command4_Click()
On Error Resume Next
Set fldel1 = New FileSystemObject
Set fldel2 = New FileSystemObject

Dim jum As Integer
For jum = 0 To List1.ListCount
Text4.Text = List1.List(jum)
List1.SetFocus
List1.Selected(jum) = True

'fldel1.DeleteFile (List1.List(jum))
Kill (List1.List(jum))
pouse 0.05
Next jum
MsgBox "Data telah terhapus!", vbInformation, "Pesan"
End Sub

Private Sub Drive1_Change()
On Error GoTo rr
Dir1.path = Drive1.Drive

rr:
If Err.Number = 68 Then
MsgBox "Peralatan tidak ditemukan!", vbInformation, "Pesan"
Else
End If
End Sub

Tidak ada komentar:

Posting Komentar