搜寻指定路径下的所有文件。急~~~
搜寻指定路径下的所有文件,包括子文件夹中的文件
指点一下,急~~~
问题点数:20、回复次数:6Top
1 楼ALong_Yue()回复于 2002-04-02 14:57:48 得分 5
CFileFindTop
2 楼mbxxx(zhoutong)回复于 2002-04-02 15:04:53 得分 5
CFileFind::FindFile
virtual BOOL FindFile( LPCTSTR pstrName = NULL, DWORD dwUnused = 0 );
Return Value
Nonzero if successful; otherwise 0. To get extended error information, call the Win32 functionGetLastError.
Parameters
pstrName
A pointer to a string containing the name of the file to find. If you pass NULL for pstrName, FindFile does a wildcard (*.*) search.
dwUnused
Reserved to make FindFile polymorphic with derived classes. Must be 0.
Remarks
Call this member function to open a file search.
After calling FindFile to begin the file search, call FindNextFile to retrieve subsequent files. You must call FindNextFile at least once before calling any of the following attribute member functions:
GetCreationTime
GetFileName
GetFileTitle
GetFilePath
GetFileURL
GetLastAccessTime
GetLastWriteTime
GetLength
GetRoot
CFileFind Overview | Class Members | Hierarchy Chart
See Also CFileFind::FindNextFile
Top
3 楼huqiming(Super)回复于 2002-04-02 15:10:22 得分 10
BOOL ok = find.FindFile("c:\\");
while(ok)
{
ok = find.FindNextFile();
if(find.IsDots())
continue;
if(find.IsDirectory())
.......
CString sName = find.GetFilePath();
}
find.Close();Top
4 楼newKoala(金猪宝贝)回复于 2002-04-02 20:15:04 得分 0
前面的问题已经解决了
谢谢
分数一定给
此外,
能否简单介绍一下在文件搜索过程中的递归应用
Top
5 楼newKoala(金猪宝贝)回复于 2002-04-04 11:21:16 得分 0
GAME OVER !Top
6 楼xingkong(暗礁)回复于 2002-04-04 11:30:57 得分 0
用CFileFind类,具体用法见msdnTop




