OK I am now 3 errors away from completing my goal of getting this program to work but the function I am using goes like this..
Public Iterator Function _matches(ByVal path As String) As IEnumerable(Of FileInfo)
Dim findData As New Win32.FindData()
Dim fileName As String
Using handle As Win32.SafeFindHandle = Win32.SafeNativeMethods.FindFirstFile(path.Combine(path, "*"), findData)
If Not handle.IsInvalid Then
Do
fileName = findData.fileName
If String.IsNullOrEmpty(fileName) Then
Continue Do
End If
If String.Equals(fileName, ".", StringComparison.Ordinal) Then
Continue Do
End If
If String.Equals(fileName, "..", StringComparison.Ordinal) Then
Continue Do
End If
If 0 <> (CInt(FileAttributes.Directory) And findData.fileAttributes) Then
If m_includeSubDirs Then
For Each fi As FileInfo In _matches(path.Combine(path, fileName))
Yield Async(fi)
Next fi
End If
Else
For Each fileSpec As Regex In m_fileSpecs
If fileSpec.IsMatch(fileName) Then
Yield New FileInfo(path.Combine(path, fileName))
Exit For
End If
Next fileSpec
End If
Loop While Win32.SafeNativeMethods.FindNextFile(handle, findData)
End If
End Using
End Function
End Class
Microsoft has released the new yield in async iterator but it is for some reason giving me problems in 3 places giving Me problems where ever the instruction " Path.Combine " is used.....
Hear is the exact lines I am trying to fix from this Function:
(1). Using handle As Win32.SafeFindHandle = Win32.SafeNativeMethods.FindFirstFile(path.Combine(path, "*"), findData)
(2). For Each fi As FileInfo In _matches(path.Combine(path, fileName))
(3). Yield New FileInfo(path.Combine(path, fileName))
I hope I have given enough Information about my problem as I badly need it to work Thank you all very much in advance :)