如何打开HTTP连接并使用URL读取文件? [英] How to open the HTTP connection and read the file using URL?

查看:343
本文介绍了如何打开HTTP连接并使用URL读取文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何打开HTTP连接并使用URL读取文件?我想读取给定URL中的文件,并希望将其保存在char或CString中,而不是将文件保存在硬盘中.只是想在变量中读取它.

How to open the HTTP connection and read the file using URL? I want to read the file in the given URL and want to save it in a char or CString, without saving the file in hard drive. Just want to read it in a variable.

推荐答案

1)打开Goog​​le

2)输入:inet-functions winapi

3)单击第一个链接( http://graphcomp.com/info/specs/ms/inetr001.htm [ ^ ])
1) Open Google

2) typ in: inet-functions winapi

3) click on the first link (http://graphcomp.com/info/specs/ms/inetr001.htm[^])



WinInet是用于应用程序与FTP交互以及HTTP协议访问Internet资源的API.
有关更多信息,请单击以下链接.

http://msdn.microsoft.com/en-us/library/aa385331%28v = VS.85%29.aspx [ ^ ]

http://msdn.microsoft.com/en-us/library/aa383630%28v = vs.85%29.aspx [ ^ ]

这是一个示例代码:
http://www.programmershelp.co.uk/showcode.php?e=57 [ ^ ]
Hi,
The WinInet is the API which is used for applications to interact with FTP, and HTTP protocols to access Internet resources.
For more information you can follow these links.

http://msdn.microsoft.com/en-us/library/aa385331%28v=VS.85%29.aspx[^]

http://msdn.microsoft.com/en-us/library/aa383630%28v=vs.85%29.aspx[^]

Here is an example code:
http://www.programmershelp.co.uk/showcode.php?e=57[^]


这篇关于如何打开HTTP连接并使用URL读取文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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