C盘下有一个a.exe的文件,用哪个API函数确认它是否存在硬盘上

来源:百度知道 编辑:UC知道 时间:2024/05/29 15:30:14

咋这么懒涅,MSDN的东东,我给你贴上了!

CFileFind finder;
static const TCHAR szFileToFind[] = _T("C:\\WINDOWS\\SYSTEM.INI");

BOOL bResult = finder.FindFile(szFileToFind);

if (bResult)
{
finder.FindNextFile();

cout << "Root of " << szFileToFind;
cout << " is " << (LPCTSTR) finder.GetRoot();
cout << endl;

cout << "Title of " << szFileToFind;
cout << " is " << (LPCTSTR) finder.GetFileTitle();
cout << endl;

cout << "Path of " << szFileToFind;
cout << " is " << (LPCTSTR) finder.GetFilePath();
cout << endl;

cout << "URL of " << szFileToFind;
cout << " is " << (LPCTSTR) finder.GetFileURL();
cout << endl;