0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

超簡単!Win32 API でURLからファイルをダウンロードする

Posted at

URLDownloadToFileW()関数で一発OK!

main.cpp
#include <Windows.h>
#include <string>

#pragma comment(lib, "urlmon.lib")

int main()
{
    std::wstring dwnld_URL = L"https://github.com/jwallet/spy-spotify/releases/download/1.12/Spytify-v.1.12.zip";
    std::wstring savepath = L"C:\\temp2\\Spytify-v.1.12.zip";
    URLDownloadToFileW(NULL, dwnld_URL.c_str(), savepath.c_str(), 0, NULL);
    return 0;
}

mingwのg++などでコンパイルするさいはリンクライブラリとして「-lurlmon」を追加のこと。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?