// PathGetLogicalDrives.cpp : メイン プロジェクト ファイルです。 #include "stdafx.h" using namespace System; using namespace System::IO; void PathGetLogicalDrives() { // 論理ドライブ名をすべて取得する array^ stDrives = Directory::GetLogicalDrives(); // 取得した論理ドライブ名をすべて表示する for each (String^ stDrive in stDrives) { Console::WriteLine(stDrive); } // 論理ドライブ名をすべて取得する array^ stDrives2 = Environment::GetLogicalDrives(); // 取得した論理ドライブ名をすべて表示する for each (String^ stDrive2 in stDrives2) { Console::WriteLine(stDrive2); } } int main(array ^args) { PathGetLogicalDrives(); return 0; }