PathFileExists和PathIsDirectory

头文件:shlwapi.h


原型:

BOOL PathFileExists(LPCTSTR lpszPath);

BOOL PathIsDirectory(LPCTSTR pszPath);

如果是一个有效的路径或文件时,返回TRUE,否则返回FALSE。



注:当调用以上函数时,要添加头文件和库文件

添加库文件的方法:#pragma comment(lib, "shlwapi.lib")