DeleteFile 删除文件

#include <Windows.h>
#include <tchar.h>

int WINAPI _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR lpCmdLine,
                     int nCmdShow) 
{
    DeleteFile(_T("D:\\1.txt"));

    //参数:目标文件的完整路径,只能删除普通权限的文件,只读文件需先去除只读权限。

    return 0;
}

猜你喜欢

转载自www.cnblogs.com/Open-Source/p/10673320.html