#include <iostream>
#include <windows.h>
#include <time.h>
#include <string>
#define CFG_FILE_PATH "dennis_check.txt"
using namespace std;
int test_exits(const string &path)
{
WIN32_FIND_DATA result;
HANDLE hFile;
hFile = FindFirstFile(path.c_str(), &result);
if (hFile == INVALID_HANDLE_VALUE)
return 3;
FindClose(hFile);
return 10;
}
int main() {
// wchar_t * text;
// text = (wchar_t*)malloc(sizeof(wchar_t) * 100);
wscanf(L"%s", text);
// std::wcin >> text;
// std::wcout << text << std::endl;
int a;
a = test_exits("C:\\Users\\JKC123456\\Desktop\\dennis\\untitled1\\dennis_check.txt");
cout<< a << endl;
return 0;
}
C++ 判断文件是否存在
最新推荐文章于 2023-11-10 13:02:03 发布