我有一个包含多个子目录的目录,其中包含 .doc 文件。例子:
C:\Users\tmedina\Documents\testenviroment\Released\500\test0.doc
C:\Users\tmedina\Documents\testenviroment\Released\501\test1.doc
C:\Users\tmedina\Documents\testenviroment\Released\502\test2.doc
...
C:\Users\tmedina\Documents\testenviroment\Released\520\test20.doc
在下面的代码中,我试图在列表框中显示所有以扩展名“.doc”结尾的文件,这些文件位于C:\Users\tmedina\Documents\testenviroment\Released
例如,我有
Dim root As String = "C:\Users\tmedina\Documents\testenviroment"
For Each fileFound As String In Directory.GetFiles(Path.Combine(root, "Released\*\*.doc"))
ListBox1.Items.Add(fileFound)
Next
但它不断抛出Illegal characters in path
错误。关于我做错了什么有什么建议吗?