方法一:
BOOL PathFileExists(
LPCTSTR pszPath );
Minimum DLL Version | shlwapi.dll version 4.71 or later |
---|---|
Custom Implementation | No |
Header | shlwapi.h |
Import library | shlwapi.lib |
Minimum operating systems | Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0 |
方法二:
如果 GetFileAttributes(yourfilefullpathname)==-1则说明文件不存在
注:不建议使用打开文件来判断文件是否存在。