Private Function GetBackUpFile(ByVal fileName As String, ByVal backupPath As String) As String
Try
Dim flg = False
Dim fileList = Directory.GetFileSystemEntries(backupPath)
For Each filePath In fileList
If Directory.Exists(filePath) Then
Dim csvPath As String = GetBackUpFile(fileName, filePath)
If csvPath IsNot Nothing Then
Return csvPath
End If
Else
If Path.GetFileName(filePath) = fileName Then
Return filePath
End If
End If
Next
Return Nothing
Catch ex As Exception
Return Nothing
End Try
End Function
从一个文件夹中查找一个文件——递归
最新推荐文章于 2024-04-16 13:36:54 发布