我正在使用此内置方法从目录中搜索文件:
foreach (string file in SafeFileEnumerator.EnumerateFiles(folderBrowserDialog1.SelectedPath, "*.*", SearchOption.AllDirectories))
{
}
搜索时是否可以在我的 UI 上显示当前目录?
If your SafeFileEnumerator
is the Directory class then the answer is No just keep track of the result from System.IO.Path.getDirectory(file)
and act when it changes.
If it is the class from this question, then you can change the code to raise an event.