想请教一下,如果一个单文档的程序,怎样实现在客户区枚举某个文件夹里的所有文件啊?
解决方案 »
- VC 执行ACCSEE视图
- 懂DEPHI的进来帮忙翻译成C++
- 各位帅哥。。帮忙看看(DEBUG Assertion failed问题)
- 关于ON_COMMAND_RANGE的问题:我按顺序排列id,为什么还不行
- 请做过智能卡发卡程序的达人帮我看看程序有什么问题?
- _finite函数的作用是什么
- 如何从字符串 "+OK 12 1256\r\nxxxesasgeg" 中获得子串 "12" 和 "1256"
- 在windows下如何对红外口编程进行通讯(不胜感激)
- 怎样枚举对话框内的控件,就是得到每一个控件的窗口指针。
- 北京的所谓吸引IT人才政策,大家别上当呀!!
- 关于linux网络编程远程命令调用的问题
- ado 访问数据库
This small program recurses every directory on the C:\ drive and prints the name of the directory.
*/
void Recurse(LPCTSTR pstr)
{
CFileFind finder; // build a string with wildcards
CString strWildcard(pstr);
strWildcard += _T("\\*.*"); // start working for files
BOOL bWorking = finder.FindFile(strWildcard); while (bWorking)
{
bWorking = finder.FindNextFile(); // skip . and .. files; otherwise, we'd
// recur infinitely! if (finder.IsDots())
continue; // if it's a directory, recursively search it if (finder.IsDirectory())
{
CString str = finder.GetFilePath();
TRACE(_T("%s\n"), (LPCTSTR)str);
Recurse(str);
}
} finder.Close();
}void PrintDirs()
{
Recurse(_T("C:"));
}