This looks like some kind of C++ variant; possibly managed C++.
What is label4? What does Directory::GetFiles do? I think you might be better off on a Managed C++ forum.
Are you allowed to have an empty string for the location??
Try putting in an actual path like:
String ^location="C:\\"; //root directory
actually it looks a little like objective-c
i think.
Last edited on
Nah, It's just Microsoft C++/CLI
Problem was solved, i used a file named ID and it there was the name of first file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
using namespace System;
using namespace System::IO;
using namespace System::Collections;
int main(array<System::String ^> ^args)
{
String^ path = gcnew String("C:\\");
array<String^>^fileEntries = Directory::GetFiles( path );
IEnumerator^ files = fileEntries->GetEnumerator();
if(files->MoveNext() )
{
String^ fileName = safe_cast<String^>(files->Current);
Console::WriteLine( "'{0}'.", fileName );
}
return 0;
}
|
Last edited on