Может кто-нибудь помочь мне найти решение следующей ошибки:
"фатальная ошибка C1190: для управляемого целевого кода требуется параметр '/ clr'"
Моя конфигурация ..
- Визуальная студия 2008
- Windows 7
Вот код (я получил с помощью сетевых ресурсов)
#using <mscorlib.dll>
using namespace System;
using namespace System::IO;
int main() {
// Create a reference to the current directory.
DirectoryInfo* di = new DirectoryInfo(Environment::CurrentDirectory);
// Create an array representing the files in the current directory.
FileInfo* fi[] = di->GetFiles();
Console::WriteLine(S"The following files exist in the current directory:");
// Print out the names of the files in the current directory.
Collections::IEnumerator* myEnum = fi->GetEnumerator();
while (myEnum->MoveNext()) {
FileInfo* fiTemp = __try_cast<FileInfo*>(myEnum->Current);
Console::WriteLine(fiTemp->Name);
}
}