2020-11-20--06--有错误不用怕

2020-12-01  本文已影响0人  heiqimingren
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;
}
上一篇下一篇

猜你喜欢

热点阅读