I'm a beginner and I'm trying to step through all files in a directory and its subdirectorys. I have this:
Imports
SystemImports System.IO Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For Each filePath As String In IO.Directory.GetFiles("C:\test", "*.*", IO.SearchOption.AllDirectories) '
MsgBox(filePath)
Next filePath
End Sub
But I get the error message 'SearchOption' is not a member of 'IO'
What to do?
Niradhip ChakrabortyPosted Jul 2, 2008, 4:03 PM
check out the vb code:
Note: In your code,you are using 'searchoption' which is not a member of IO. It means
Imports System.IO doesn't have any definition for 'searchoption'.
Check out the following articles for more information:
http://www.codeproject.com/KB/files/findallfiles.aspx
http://bloggingabout.net/blogs/jschreuder/archive/2006/05/31/12272.aspx
PerPosted Jul 2, 2008, 2:58 PM
Oh, that was a lot of code for this and I don't know how to change your code to VB.
And, why does my code not work?
Niradhip ChakrabortyPosted Jul 2, 2008, 2:48 PM
Note: Hey this code is in c#. Change it to vb