URLDownloadToFile函数
2008-04-03 09:44
441 查看
Downloads bits from the Internet and saves them to a file.
Syntax:
szURL Pointer to a string value containing the URL to be downloaded. Cannot be set to NULL.
szFileName
Pointer to a string value containing the name of the file to create for bits that come from the download.
dwReserved Reserved. Must be set to 0. lpfnCB Pointer to the caller's IBindStatusCallback interface. URLDownloadToFile calls this interface's IBindStatusCallback::OnProgress method on a connection activity, including the arrival of data. IBindStatusCallback::OnDataAvailable is never called.
#include "stdafx.h"
#include <iostream>
#include <UrlMon.h>
#pragma comment(lib, "urlmon.lib")
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
//nt * dl = new int;
HRESULT hr = URLDownloadToFile(0, _T("http://ui.the9.com/wowshell/WoWShell.exe"),_T("D://WoWShell.exe"), 0,NULL);
if (hr== S_OK)
{
cout<< "ok"<< endl;
}
return 0;
}
Syntax:
HRESULT URLDownloadToFile( LPUNKNOWN pCaller, LPCTSTR szURL, LPCTSTR szFileName, DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB );
Parameters:pCaller Pointer to the controlling IUnknown interface of the calling Microsoft ActiveX component (if the caller is an ActiveX component).
szURL Pointer to a string value containing the URL to be downloaded. Cannot be set to NULL.
szFileName
Pointer to a string value containing the name of the file to create for bits that come from the download.
dwReserved Reserved. Must be set to 0. lpfnCB Pointer to the caller's IBindStatusCallback interface. URLDownloadToFile calls this interface's IBindStatusCallback::OnProgress method on a connection activity, including the arrival of data. IBindStatusCallback::OnDataAvailable is never called.
#include "stdafx.h"
#include <iostream>
#include <UrlMon.h>
#pragma comment(lib, "urlmon.lib")
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
//nt * dl = new int;
HRESULT hr = URLDownloadToFile(0, _T("http://ui.the9.com/wowshell/WoWShell.exe"),_T("D://WoWShell.exe"), 0,NULL);
if (hr== S_OK)
{
cout<< "ok"<< endl;
}
return 0;
}
相关文章推荐
- 在ActiveX中使用URLDownLoadToFile函数中的参数问题
- vb URLDownloadToFile下载函数
- 为 URLDownloadToFile 函数实现进度条
- URLDownloadToFile
- URLDownloadToCacheFile,下载文件到缓存中
- URLDownloadToFile进度回调
- URLDownloadToFileW
- 解决URLDownloadToFile缓存问题的两种方法【转】
- URLDownloadToFile详解
- URLDownloadToFile下载文件文章两篇
- 解决URLDownloadToFile缓存问题的两种方法【转】
- vb urldownloadtofile 下载 及 容易发生的问题
- (转)URLDownloadToFile
- 为 URLDownloadToFile 实现进度条
- 用URLDownloadToFile下载文件
- UrlDownloadtoFile文件下载,进度条,下载暂停,停止的简单实现
- URLDownloadToFile
- Windows客户端开发--URLDownloadToFile下载文件进度条
- URLDownloadToFile调用返回E_ABOR问题
- 一个使用URLDownloadToFile实现文件下载的类