ENGLISH page is here.
GET DinopSearchBar
サイト内検索:
HOME
VC++ TIPS
ダウンロード
DinopExifReader
DinopSearchBar
DinopSearchBar mini
DinopTabbingBar
for Firefox
大阪湾の生き物
甲子園浜の自然
甲子園浜の干潟
甲子園浜の水中
甲子園浜の野鳥
近畿の山々
植物図鑑
箕面マップ
水中機材
カメラ
ランキング
望遠鏡の世界
顕微鏡の世界
Googleのすべて
GoogleマップAPI
ニュース
読んだ本
日記
変な料理の作り方
遺伝子操作
論文紹介
デイトレード
自動売買でFX
ネットで小遣い稼ぎ
Solaris
電子工作
その他
問い合わせ
VC++用コード集
大阪湾の生き物
水中用機材
since:2000/11/15
dinopcom@gmail.com
www.dinop.comは
だいのっぷ・どっと・こむ
と読んでください。







« フォルダ内のファイル列挙 | メイン | チップセットの判別法 »

フォルダ内のフォルダ列挙




解説


   フォルダ内に存在する全てのフォルダ名を取得する。

   得られる結果はフォルダ名順に並んでいるわけではない。そのため必要に応じて
   並べ替える必要がある。


使用例

bool	GetAllFolderFromFolder(CStringArray& astrFolders,CString strFolder);

//フォルダ内にあるフォルダを列挙
void	test(void)
{
	int				i;
	CString			strText;
	CStringArray	astrFolders;

	GetAllFolderFromFolder(astrFolders,"c:\\");

	for(i = 0; i < astrFolders.GetSize(); i++)
	{
		strText += astrFolders[i];
		strText += "\n";
	}
	AfxMessageBox(strText);
}


//
//	フォルダ内のフォルダを列挙
//
bool	GetAllFolderFromFolder(CStringArray& astrFolders,CString strFolder)
{
	BOOL			bContinue;
	CFileFind		cFind;

	astrFolders.RemoveAll();

	if(strFolder.Right(1) != "\\")
		strFolder += "\\";
	strFolder += "*.*";

	bContinue = cFind.FindFile(strFolder);

	while(bContinue)
	{
		bContinue = cFind.FindNextFile();

		if(cFind.IsDirectory() != FALSE)
			astrFolders.Add(cFind.GetFilePath());
	}

	return	true;
}








Copyright (c) 1999-2007 issei. All rights reserved. (運営者情報