Following the example provided by microsoft for Directory::GetDirectory I came to this piece of code:

auto k = System::IO::Directory::GetDirectories(installpath);
auto dir = k->GetEnumerator();
while (dir->MoveNext())
    {
       String^ subdirectory = safe_cast<String^>(dir->Current);
       MessageBox::Show(subdirectory);
    }

which should list all directories in installpath, right? Well it doesn't appear to work! (no messagebox) How do I fix this?

note: installpath exists and has subdirectories

有帮助吗?

解决方案

Oh, silly me ! Installpath was 1 folder deeper and had nothing in it ! Sorry for the inconvenience!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top