Well here goes........ All week I have been trying to figure out recrusion to search all folders and subfolders to no luck do I fully understand it so I asked a few questions here and got the responce that I can use the get files method to search an entire dir such a C:\ for the file im looking for. the problem here is my ignorance to details....... I need to know where to place this code so that it will allow the user to select a root dir from a combobox like c,d,e,f ect and then press start to check the computer for names listed in a text file......MY GOD SOMEONE PUT AN END TO MY SUFFERING!! :(
the code I have is from the MSDN website
Imports System
Imports System.IO
Imports System.Collections
Public Class form1
Public Overloads Shared Sub Main(ByVal args() As String)
Dim path As String
For Each path In args
If File.Exists(path) Then
ProcessFile(path)
Else
If Directory.Exists(path) Then
ProcessDirectory(path)
Else
Console.WriteLine("{0} is not a valid file or directory.", path)
End If
End If
Next path
End Sub
Public Shared Sub ProcessDirectory(ByVal targetDirectory As String)
Dim fileEntries As String() = Directory.GetFiles(targetDirectory)
Dim fileName As String
For Each fileName In fileEntries
ProcessFile(fileName)
Next fileName
Dim subdirectoryEntries As String() = Directory.GetDirectories(targetDirectory)
Dim subdirectory As String
For Each subdirectory In subdirectoryEntries
ProcessDirectory(subdirectory)
Next subdirectory
End Sub
Public Shared Sub ProcessFile(ByVal path As String)
Console.WriteLine("Processed file '{0}'.", path)
End Sub
End Class
but how do i make this work with the following
3.buttons of your choice perferably start stop and delete
1.combobox checkbox from devexpress
1 or 2 text or list boxes
anything else?
please please give me something to work with so I can move on from this nightmare
thanks again people.....
I think I need to re phrase my question the best i can
1) the user selects a root dir in the combobox (example....C:\)
2) the text file with the virus names is loaded into a textbox for the user to see
3) start scan is enabled and the search goes into every folder in the root dir untill the text file is done
4) the matched search results from the text file are shown in a text or listbox for the user to review and delete - Dale Seeley 3 mins ago