如何从https下载特定文件 [英] How can download a specific file from https

查看:197
本文介绍了如何从https下载特定文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好:
我使用Serv-U创建了一个https服务器,URL为:https://10.172.149.43.如果我使用IE网站,则可以登录https,并且可以从https下载文件.现在我想知道如何自动下载特定文件(LabVIEW,C ++,任何人都可以!)

Hi all:
I created a https server using Serv-U,the URL is:https://10.172.149.43. I can login the https if i use the IE web, and can download file from the https. Now i want to know how can i download a specific file automatically(LabVIEW,C++,anyone is OK!)

推荐答案

您可以像使用HTTP一样完全使用HTTPS,使用类System.Net.HttpWebRequest.如果下面的MSDN页面,请参见说明:您应该使用System.Net.WebRequest.Create来获取HttpWebRequest的实例,而不是HttpWebRequest构造函数;具体的运行时类型将从URL模式中找出(在您的情况下为https://).

参见:
http://msdn.microsoft.com/en-us/library/system.net. httpwebrequest.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/system.net. webrequest.aspx [ ^ ](请参阅HTTP的代码示例,但使用"https://...").

我不知道您的身份验证页面的详细信息,但是如果这是带有用户名/密码的常规Web表单,则可以使用"POST"方法登录.
这可以给你一个主意:
http://social.msdn.microsoft.com/Forums/zh/ncl/thread/105a3dcc-949f-4f1a-887e-40fedb9f2b62 [
You can work with HTTPS exactly as with HTTP, using the class System.Net.HttpWebRequest. See the explanation if the MSDN page below: you should use System.Net.WebRequest.Create to get the instance of HttpWebRequest, not HttpWebRequest constructor; concrete run-time type will be figured out of URL schema (https:// in your case).

See:
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx[^],
http://msdn.microsoft.com/en-us/library/system.net.webrequest.aspx[^] (see code sample for HTTP, but use "https://...").

I don''t know detail of your authentication page, but if this is a regular Web form with user name/password, you can log in using "POST" method.
This can give you the idea:
http://social.msdn.microsoft.com/Forums/en/ncl/thread/105a3dcc-949f-4f1a-887e-40fedb9f2b62[^].

—SA


是的,我们都很好,谢谢...但是,请您告诉我们您到目前为止一直在尝试什么?你有什么问题? ...

我们将为您提供帮助,但是首先我们需要知道尝试一下会发生什么...

PS:google是您的朋友...(我想大多数人都错过了R,然后没人使用它)...

搜索:"https下载文件c ++"将为您带来不错的结果...其中:

http://www.cplusplus.com/src/ [
Yes, we are all fine, thanks... but please, could you tell us what have you tried till now? what problems do you have? ...

We will help you, but first we need to know what happens to even try it...

PS: google is your fRiend... (I guess most of the people misses that R and then no one uses it)...

searching for that: "https download files c++" will give you nice results... among them:

http://www.cplusplus.com/src/[^]


HTH...


这篇关于如何从https下载特定文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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