기본카테고리

[vc++] URLDownloadToFile 로 파일 다운로드

DevReff 2021. 4. 13. 08:08




728x90


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

 


CString sUrl = _T("https://search.pstatic.net/common/?src=http%3A%2F%2Fblogfiles.naver.net%2FMjAyMTA0MDNfMjQ3%2FMDAxNjE3Mzc3MTg5MDE3.aapkr0dkgPIQZWCyRO6bJ5uu39EEa9D31-1-Lq_L93Eg.6qeVkKgZnn5Dyp1seKuBLE1xwwcu10ruDl_94N6Y3rYg.JPEG.in_korean_style%2F133975944_1306789203020595_8251479565197817982_n.jpg&type=sc960_832");
CString sFilename = _T("C:/Users/Smart/Documents/홍지윤.jpg");
DeleteUrlCacheEntry(sUrl);
HESULT rs = URLDownloadToFile(NULL, sUrl, sFilename, 0, NULL);