
image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

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
{
DWORD derr = GetLastError();
MessageBox(NULL, _T("下载失败123!"), _T("Tip"), MB_OK);
}
return 0;
}
网友评论