如何从使用Windows和C URL数据? [英] How to get data from URL using Windows and C?

查看:152
本文介绍了如何从使用Windows和C URL数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要打开在用户的Web浏览器的URL是很容易的:

To open a URL in the user's web browser is easy enough:

ShellExecuteA(NULL, "open", url, NULL, NULL, SW_SHOWNORMAL);

我怎么叫,而不是使用指定的URL来检索从一个网站的数据?在Mac上,我会使用:

What do I call instead to retrieve data from a website using a given URL? On the Mac, I'd use:

URLSimpleDownload(url, NULL, newDataH, 0, NULL, NULL);

它存储在newDataH处理来自URL检索的数据。很容易的。对此有一个等效的Windows?

It stores in the newDataH handle the data retrieved from url. Easy enough. Is there an equivalent for this on Windows?

推荐答案

您可能正在寻找的 InternetReadFile的功能=HTTP:// MSDN .microsoft.com / EN-US /库/窗/台式机/ aa385103%28V = VS.85%29.aspx相对=nofollow> 的WinINet。

You're probably looking for the InternetReadFile function in WinINet.

下面是常用功能的API在一个不错的列表:的常用功能

Here is a nice list of common functions in that API: Common functions

这篇关于如何从使用Windows和C URL数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆