我正在尝试将一段 C# 代码转换为 C++/CLI。
C#代码:
DirectoryInfo dir = new DirectoryInfo(path);
DirectoryInfo [] subdirs;
foreach (DirectoryInfo subdir in dir.GetDirectories())
Search(subdir.Fullname);
我已经完成了,直到最后一行;
C++ 代码:
System::IO::DirectoryInfo^ dir = gcnew DirectoryInfo(dirbxSearch->Path);
array <System::IO::DirectoryInfo^>^ subdirs;
for each (System::IO::DirectoryInfo^ subdir in dir->GetDirectories())
Search(subdir->FullName);
问题是我不知道搜索来自哪里。作为一个模棱两可的词,我也无法在任何参考文献中找到它。没有正确的继承,它无法编译,所以我有点卡住了。