我的VC里有段移植的代码要用到这两个函数,TC的dir.h和dos.h里也没有?那位大哥知道是怎么写的?
解决方案 »
- 在一个线程里throw,在程序的什么位置try呢?
- AfxBeginThread调用不了,设置中已经改了多线程了,并且使用了mfc.
- 基于对话框的mfc应用程序中,在应用程序的InitApplication事件能否显示窗口,要是能如何做啊?
- Help me: COM BSTR 字符串与wchar_t*字符串能相互转换吗?
- 网页中的Com组件,怎么样能够穿过NTLM默认认证的代理服务器
- 哪里有《COM原理与应用》的电子书下载?
- 使用xmlhttp请求一个网页后,再次请求还是上一次的内容.
- 哪位大侠知道rpg游戏是怎么做的?
- vc当中的全文检索
- 各位仁兄,VC++中可有类似于VB中的DataGrid显件表中所有记录的控件
- 怎样在对话框没显示前设置控件属性?
- VC中使用dialog获得用户名和密码访问数据库能实现吗?怎么实现?
_findfirst
_findnext 么?
看MSDN是否是想要的
long handle;
struct _finddata_t filestruct;
char path_search[_MAX_PATH];
handle = _findfirst("目录",&filestruct);
if((handle == -1)) return;
if( ::GetFileAttributes(filestruct.name)& FILE_ATTRIBUTE_DIRECTORY )
{
if( filestruct.name[0] != '.' )
{
_chdir(filestruct.name);
Search_Directory(szFilename);
_chdir("..");
}
}
else
{
if( !stricmp(filestruct.name, szFilename) )
{
strcat(path_search,"\\");
strcat(path_search,filestruct.name);
MessageBox(path_search);
}
}
while(!(_findnext(handle,&filestruct)))
{
if( ::GetFileAttributes(filestruct.name) &FILE_ATTRIBUTE_DIRECTORY )
{
if(*filestruct.name != '.')
{
_chdir(filestruct.name);
Search_Directory(szFilename);
_chdir("..");
}
else
{
if(!stricmp(filestruct.name,szFilename))
{
_getcwd(path_search,_MAX_PATH);
strcat(path_search,"\\");
strcat(path_search,filestruct.name);
MessageBox(path_search);
}
}
}
_findclose(handle);
}
DOS程序用int 21h的4e和4f号功能;Windows程序用FindFirstFile、FindNextFile。