vc++6.0文件操作问题

来源:百度知道 编辑:UC知道 时间:2024/06/30 05:04:25
想知道哪里错了,总是编不了。提示'Cfilefind' : undeclared identifier

#include <iostream>
#include "stdafx.h"
#include <afx.h>
#include <stdio.h>
#include <string.h>

int main(int argc, char* argv[])
{
CString strFileTitle;

Cfilefind cf;
BOOL bWorking = cf.FindFile("d:\\*.rar");
while(bWorking)
{
bWorking=cf.FindNextFile();
strFileTitle=finder.GetFileTitle();
printf("%s\n" ,strFileTitle);

}
system("PAUSE");

return 0;
}

#include <iostream>
//#include "stdafx.h" 不知道你要它做什么,光这个程序的话,不需要
#include <afx.h>
#include <stdio.h>
#include <string.h>

int main(int argc, char* argv[])
{
CString strFileTitle;

CFileFind cf; //你说错在这里,保证大小写正确就行!C++对大小写敏感,请时刻牢记
BOOL bWorking = cf.FindFile("d:\\*.rar");
while(bWorking)
{
bWorking=cf.FindNextFile();
strFileTitle=cf.GetFileTitle(); //这里源程序里写了个finder,没这个变量,改CF
printf("%s\n" ,strFileTitle);

}
system("PAUSE");

return 0;
}

测试通过!收分,谢谢~

CFileFind.....
StdAfx.h?怎么会....太强了