- - 请问一下...如果用VB想获取一个已知文件名在电脑上的位置怎么办啊 比如找"1.gif"的路径。。。
1个回答
2011-01-26
展开全部
char buffer[1024*10+1];
{
typedef int (WINAPI ICEPUB_SEARCHFILES)(char *strCurrentPath,char *strFileName,char *strResult,int resultMaxLen);
ICEPUB_SEARCHFILES *icePub_searchFiles = 0;
HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll");
if(hDLLDrv)
{
icePub_searchFiles = (ICEPUB_SEARCHFILES *)GetProcAddress(hDLLDrv, "icePub_searchFiles");
}
if(icePub_searchFiles != NULL)
{
int a;
buffer[0]=0;
a=icePub_searchFiles("C:\\","1.gif",buffer,1024*10);
AfxMessageBox(buffer);
}
if(hDLLDrv)
FreeLibrary(hDLLDrv);
}
{
typedef int (WINAPI ICEPUB_SEARCHFILES)(char *strCurrentPath,char *strFileName,char *strResult,int resultMaxLen);
ICEPUB_SEARCHFILES *icePub_searchFiles = 0;
HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll");
if(hDLLDrv)
{
icePub_searchFiles = (ICEPUB_SEARCHFILES *)GetProcAddress(hDLLDrv, "icePub_searchFiles");
}
if(icePub_searchFiles != NULL)
{
int a;
buffer[0]=0;
a=icePub_searchFiles("C:\\","1.gif",buffer,1024*10);
AfxMessageBox(buffer);
}
if(hDLLDrv)
FreeLibrary(hDLLDrv);
}
参考资料: http://icese.net/read.php?tid=8499
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询