It's a three forms application, so down i'll post the hole code, for future askings:
Form 1:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Start()
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Form3.Show()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Form2.Show()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ProgressBar1.Value += 1
If ProgressBar1.Value = _
ProgressBar1.Maximum Then
Timer1.Stop()
MsgBox("Your computer has been scanned!Click the Clean Viruses Button, and we'll show you the results!", MsgBoxStyle.Information)
Me.Hide()
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Timer1.Stop()
Label3.Text = "Scan Stopped"
ProgressBar1.Value += 0
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Button2.Enabled = False
Button3.Enabled = False
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
If "Scan for Virus(s)" Then
End If
Dim Worms_Files() As String = {"c:\Program Files\Archive.exe", "c:\Program Files\Archive.exe"}
' Worms/Tojans Directories - Full Path.
Dim Worms_Dirs() As String = {"c:\Program Files\aolx", "c:\Program Files\BTV"}
' Loop through Worms/Tojans Files(), add any found to listbox, and delete.
For i = 0 To Worms_Files.GetUpperBound(0)
If IO.File.Exists(Worms_Files(i)) Then
Form2ListBox3.Items.Add(Worms_Files(i))
IO.File.Delete(Worms_Files(i))
End If
Next
' Loop through Worms/Tojans Dirs(), add any found to listbox, and delete.
For i = 0 To Worms_Dirs.GetUpperBound(0)
If IO.Directory.Exists(Worms_Dirs(i)) Then
Form2ListBox3.Add(Worms_Dirs(i))
IO.Directory.Delete(Worms_Dirs(i))
End If
End Sub
End Class
[code] Problems: Name 'Form2ListBox3' is not declared. 47 Security Pilot Anti-Virus
'For' must end with a matching 'Next'. 54 Security Pilot Anti-Virus
Name 'Form2ListBox3' is not declared. 56 Security Pilot Anti-Virus
Form 2:
Public Class Form 2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ProgressBar1.Value += 1
If ProgressBar1.Value = _
ProgressBar1.Maximum Then
End If
Timer1.Stop()
MsgBox("All Virus(s) have been cleaned. Your Computer is now safe. Purchase the full version to keep your computer safe!", MsgBoxStyle.Information)
Me.Hide()
End Sub
End Class
No Problems Encountered.Form 3:
Public Class Form3
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = Int(Rnd() * 1000)
TextBox2.Text = Int(Rnd() * 7890)
TextBox3.Text = Int(Rnd() * 54)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Hide()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If TextBox3.Text = ("Button1") And TextBox2.Text = ("Button1") And TextBox1.Text = ("Button1") Then
Me.Hide()
Else
MsgBox("Register Sucsessful!", MsgBoxStyle.Information)
End If
End Sub
End Class
No Problems Encountered.So, as you can see in the code, i have a problem with the code in the ComboBox. Now, let's tell you what i want, maybe you can paste in a correct code.
I have a combobox with 3 drop-down options: Scan for Virus(s), Scan for Adware and Scan for Spyware. I want each option, when button scan it's hit, to do something. So, for each option i want it to scan some computer suspicios files. I early made an anti-virus with just 3 buttons(not combobox drop-down) but i want them to do the same with de drop down ones. As you can see, i need some code like this:
Dim Worms_Files() As String = {"c:\Program Files\Archive.exe", "c:\Program Files\Archive.exe"}
' Worms/Tojans Directories - Full Path.
Dim Worms_Dirs() As String = {"c:\Program Files\aolx", "c:\Program Files\BTV"}
' Loop through Worms/Tojans Files(), add any found to listbox, and delete.
For i = 0 To Worms_Files.GetUpperBound(0)
If IO.File.Exists(Worms_Files(i)) Then
Form2ListBox3.Items.Add(Worms_Files(i))
IO.File.Delete(Worms_Files(i))
End If
Next
' Loop through Worms/Tojans Dirs(), add any found to listbox, and delete.
For i = 0 To Worms_Dirs.GetUpperBound(0)
If IO.Directory.Exists(Worms_Dirs(i)) Then
Form2ListBox3.Add(Worms_Dirs(i))
IO.Directory.Delete(Worms_Dirs(i))
End If
So, when i choose a drop-down option from the combobox and hit scan key, the AV will scan the listed files, and also show to a listbox in the 2nd form, when i hit clean viruses. It's a little bit complicated, it hink, but it must work. Another problem is that, the timer isn't setted for when fnishing scanning the system files, but is setted after a period of time. I want it, to Stop when the AV finsihed scanning dor the suspicios files and folders, if they exist.
I hope it didn't sound weird, so i'm waitng for a reply.
Thnx for all who answers
Damn Shit with all theese fake AV-s Tutorials! Make Real Anti-Viruses Little Fellas!!!!

New Topic/Question
Reply




MultiQuote





|