如何通过HTTP连接下载多个文件 [英] how to Download Multiple Files over HTTP Connection

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

问题描述

嗨朋友们,



i已通过此链接从HTTP连接下载多个文件。



通过HTTP连接下载多个文件 [ ^ ]



但我收到错误远程服务器返回错误:(401)未经授权。。



现在我正在解释你想做什么,因为如果有人有更好的解决方案,他们可以帮助我。

我有一个互联网网址。在该URL上,人们将每天发布新文件,并将删除现有文件,我想在c#中编写代码如果我今天运行我的应用程序已发布所有文件应该下载并移动到本地驱动器。



请帮我解决这个问题。



提前致谢。

Hi Friends,

i have gone through this link for downloading multiple file from HTTP connection.

Downloading Multiple Files over HTTP Connection[^]

But i am getting an error "The remote server returned an error: (401) Unauthorized.".

now i am explaining you what i wanted to do because if anyone have better solution they can help me.
I have an internet URL. on that URL people will post new file on daily basis and will delete existing file and i want to write code in c# if i run my application today's posted all files should be download and moved into local drive.

Please help me to come out from this issue.

Thanks in advance.

推荐答案

401表示Web服务器认为您不允许获取此资源。这可能是因为你实际上没有被授权,但也因为你没有说出你是谁。



在第一个实例中添加。 UseDefaultCredentials = true; 在拨打电话之前查看网页请求,看看它是做什么的。
401 means the webserver thinks you're not allowed to get this resource. This could be because you are not actually authorized, but also because you haven't said who you are.

In the first instance add .UseDefaultCredentials = true; to the web request prior to making the call and see what that does.


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

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