Hi.

This is my first time here and i am hoping to get some help with some of my problems?

I am learning to program in vb 2008 and have a problem with some code.
I am trying to search a drive for any .Wav files, the problem i am having is that after a while i get a denied error on some folders which i can seem to resolve.

Also the code in bold i can seem to get to work properly either and would be grateful for any help with this.



Code:
PrivateSubBrowse_Click(ByValsenderAsSystem.Object, ByValeAsSystem.EventArgs) HandlesBrowse.Click
ListBox1.Items.Clear()
ListBox1.EndUpdate()
 
IfFolderBrowserDialog1.ShowDialog() = DialogResult.OKThen
ForEachstrFileAsStringInMy.Computer.FileSystem.GetFiles((FolderBrowserDialog1.SelectedPath), Microsoft.VisualBasic.FileIO.SearchOption.SearchAllSubDirectories, "*.wav")
 
IfRegex.IsMatch(strFile, "*.wav") Then
ListBox1.Items.Add(My.Computer.FileSystem.GetName(strFile))
Else
MsgBox("No Wav files located")

EndIf
Next
EndIf
EndSub

Many thanks

worf