image.png
image.png
image.png
image.png
拷贝命令
image.png
=====================
image.png image.png
image.png
===============================================
deletefile文件,运行成功了!
image.png
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <tchar.h>
#include <URLmon.h>
using namespace std;
#pragma comment(lib,"Urlmon.lib")
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
//HRESULT hret = URLDownloadToFile(NULL, _T("https://avatar.cctry.com/uc_server/data/avatar/000/00/00/51_avatar_middle.jpg"), _T("D:\\御龙在天喊话\\123.jpg"),0, NULL);
/*if (hret == S_OK)
{
MessageBox(NULL, _T("下载成功!"), _T("Tip"), MB_OK);
}
else
{
MessageBox(NULL, _T("下载失败123!"), _T("Tip"), MB_OK);
}*/
////第二个函数的使用
//SHELLEXECUTEINFO ShellInfo = {0};
//ShellInfo.cbSize = sizeof(SHELLEXECUTEINFO);
//ShellInfo.lpVerb = _T("open");
//ShellInfo.lpFile = _T("notepad.exe");
//ShellInfo.nShow = SW_SHOW;
//BOOL bRet = ShellExecuteEx(&ShellInfo);
BOOL bRet = DeleteFile(_T("E:\\123.txt"));
if (bRet)
{
MessageBox(NULL, _T("删除成功!"), _T("tip"), MB_OK);
}
else
{
MessageBox(NULL, _T("删除失败!"), _T("tip"), MB_OK);
}
return 0;
}
复制文件函数 copyfile
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <tchar.h>
#include <URLmon.h>
using namespace std;
#pragma comment(lib,"Urlmon.lib").
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
BOOL bRet = CopyFile(_T("E:\\bird1.jpg"), _T("D:\\123.jpg"), FALSE);
if (bRet)
{
MessageBox(NULL, _T("删除成功!"), _T("tip"), MB_OK);
}
else
{
MessageBox(NULL, _T("删除失败!"), _T("tip"), MB_OK);
}
return 0;
}
网友评论