Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Visual Basic ( VB ) (http://www.go4expert.com/forums/visual-basic/)
-   -   File search problem (http://www.go4expert.com/forums/file-search-problem-t15795/)

Iona 12Jan2009 02:03

File search problem
 
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. :nonod:

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


All times are GMT +5.5. The time now is 19:26.