誰かが次のエラーの解決策を見つけるのを手伝ってくれますか:
「致命的なエラー C1190: マネージド ターゲット コードには '/clr' オプションが必要です」
私の構成は..
- ビジュアルスタジオ 2008
- ウィンドウズ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);
}
}