API函数:PathFileExists
就能完成此功能.
#include <windows.h>
#include <stdio.h>
#include <tlhelp32.h>
#include <Shlwapi.h>
#pragma comment(lib,"shlwapi.lib")
//测试代码
void Test(void)
{
if(PathFileExists("c:\\inject.txt"))
{
AfxMessageBox("Exist!!");
}
}
转载于:https://blog.51cto.com/laokaddk/324423