wldrumstcs
06-09-2010, 04:22 PM
I have a Windows service that uses System.IO to recursively retrieve files from a directory and all its subdirectories. However, when I call this function, it doesn't like the lines "Directory.GetFiles(dirPath)" and "Directory.GetDirectories(dirPath)". Any ideas why?
Thanks!
Imports System.IO
Module mdlParser
Public fileArr As New ArrayList
'* getFiles
'* - loops through the directories and subdirectories and pulls out the bloomberg files
'* parameters - dirPath: the path of the directory to start searching through
'* return val - none
Public Sub getFiles(ByVal dirPath As String)
Dim fileList() As String = Directory.GetFiles(dirPath)
Dim dirList() As String = Directory.GetDirectories(dirPath)
Dim filename As String
For Each filename In fileList
If Path.GetExtension(filename) <> ".req" Then
fileArr.Add(filename)
End If
Next
Dim dirName As String
For Each dirName In dirList
getFiles(dirName)
Next
End Sub
End Module
Thanks!
Imports System.IO
Module mdlParser
Public fileArr As New ArrayList
'* getFiles
'* - loops through the directories and subdirectories and pulls out the bloomberg files
'* parameters - dirPath: the path of the directory to start searching through
'* return val - none
Public Sub getFiles(ByVal dirPath As String)
Dim fileList() As String = Directory.GetFiles(dirPath)
Dim dirList() As String = Directory.GetDirectories(dirPath)
Dim filename As String
For Each filename In fileList
If Path.GetExtension(filename) <> ".req" Then
fileArr.Add(filename)
End If
Next
Dim dirName As String
For Each dirName In dirList
getFiles(dirName)
Next
End Sub
End Module