如题!
解决方案 »
- socketTCP 如何按消息类型发送?
- MFC控件中的值写入SQL数据库中 如何实现
- 关于数据结构的一点问题
- 哪有得到硬盘序列号/网卡MAC/CPU序列号的VC++源码?
- 如何得到dialog的标题栏的高度
- 向大家调查一个问题,希望大家给点建议
- 在CListCtrl中如何实现提示功能(象工具条提示那样)?
- 请问:项目出了问题,谁来承担责任?(请各位谈谈你公司这方面的情况)(欢迎讨论)
- 如何修改系统消息?关于WM_ACTIVATE消息 (在线等候,急!谢谢!)
- 求救:已知图象的宽度和高度,怎么计算它的打印的宽度和高度呢?help me
- 4KB的三维动画DEMO极品程序! 『曾获大赛一等奖』
- 我的控件无法使TextBox产生Validate事件
void GetFileInfo(LPCTSTR pstr)
{
int iSum;
CFileFind finder;
CString Path;
Path.Format("%s\\*.*",pstr); BOOL bWorking=finder.FindFile(Path); while (bWorking)
{
bWorking=finder.FindNextFile();
//找到的是“.”或“..”
if(finder.IsDots())
{
continue;
}
//找到的是目录
if((finder.IsDirectory()))
{
CString str=finder.GetFilePath();
int a,b;
a=g_iKnowSum;
b=g_iUnKnowSum;
GetFileInfo(str);
}
//找到的是文件
else
{
//此处添加对找到文件的操作!
}
}
}
struct _finddata_t file;
long hFile;
char szFileName[256];sprintf(szPath,"%s\\*.*","c:\\test");if( (hFile = _findfirst( szPath, &file ) ) == -1L )
{
_findclose( hFile );
return ERR;
}do
{
if ( (strcmp(file.name, ".") != 0 ) &&
(strcmp(file.name, "..") != 0) )
{
sprintf(szFileName,"%s\\%s",szPath,file.name);//file name }while( _findnext(hFile,&file) == 0); _findclose( hFile );
CString path = "d:\\*.*"; BOOL m_finding = fileFind.FindFile(path);
while(m_finding == TRUE)
{
m_finding = fileFind.FindNextFile();
if(!fileFind.IsDirectory() && !fileFind.IsDots())//文件
{
AfxMessageBox(fileFind.GetFilePath());
}
if(fileFind.IsDirectory() && !fileFind.IsDots())//目录
{
AfxMessageBox(fileFind.GetFilePath());
}
} fileFind.Close();