This is pretty simple. I'm just testing things and seeing if I can get things working and if I can then I want to try and develop this into something more. So far its just a simple button1 finds all files with extension of .mp3 in C:\ and displays all the findings in a listbox. I then want to use button2 to copy or move (I want to see how to do both) all of the files that are in that lisbox to a directory of my choosing. Here is what I have so far.
VB.NET:
Imports System.IO
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
searchdrive("c:\")
End Sub
Private Sub searchdrive(ByVal Path As String)
Try
Dim CurDir As DirectoryInfo = New DirectoryInfo(Path)
Dim DirArray() As DirectoryInfo = CurDir.GetDirectories
Dim fileInf As FileInfo
Dim dirinfo As DirectoryInfo
Dim fileArray() As FileInfo = CurDir.GetFiles
For Each dirinfo In DirArray
searchdrive(dirinfo.FullName)
Next
For Each fileInf In fileArray
If LCase(fileInf.Extension) = ".mp3" Then
ListBox1.Items.Add(fileInf.Name) '---adds Filename only to a listbox
End If
Application.DoEvents()
Next
Catch
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
CopyFiles()
End Sub
Public Sub CopyFiles()
End Sub
End Class