C++MFCDLL 程序 判断C盘Windows目录是否有1.txt 如果有责运行程序a() 如果没有则跳过程序a()
展开全部
#include <shlwapi.h>
if (PathFileExists(strDBPath))
{
//存在
}
else
{
//不存在
}
if (PathFileExists(strDBPath))
{
//存在
}
else
{
//不存在
}
追问
pathfilexists这行能给个注释吗
追答
Syntax
BOOL PathFileExists(
LPCTSTR pszPath
);
Parameters
pszPath
[in] Pointer to a null-terminated string of maximum length MAX_PATH that
contains the full path of the object to verify.
Return Value
Returns TRUE if the file exists, or FALSE otherwise. Call
GetLastError for extended error
information.
Remarks
This function tests the validity of the path. It works only on the local file
system or on a remote drive that has been mounted to a drive letter. It returns
FALSE if a mounted remote drive is out of service.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询