如何获取此文件夹中的文件夹列表? [英] How to get list of folders in this folder?
本文介绍了如何获取此文件夹中的文件夹列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何获取此文件夹中的文件夹列表?
How to get list of folders in this folder?
推荐答案
如果不能使用.NET&托管代码,您可以通过win32 api的
If you can't use .NET & Managed code, you can go through the win32 api's
Here is an example that you can modify to only get Folders.
(基本上是下面的检查:)
(Basically the following check:)
...
TCHAR szDir = _T("c:\\"); // or wherever.
HANDLE hFind = FindFirstFile(szDir, &ffd);
...
do {
if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
// your code on 'ffd'
}
} while (FindNextFile(hFind, &ffd) != 0);
这篇关于如何获取此文件夹中的文件夹列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文