C#中的WebClient,如何。 [英] WebClient in C#, how to.

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

问题描述

大家好,



i在c#中提供了一个很好的应用程序从网站下载pdf文件。现在我想让它下载一些更大的文件,如50MB或更多来自服务器/网站。我尝试下载该文件时出现问题,只下载35KB。所以我的问题是你对c#中的webclient一无所知,这可以帮助我解决我的问题。感谢您阅读本文的时间,如果您有任何啧啧,链接或其他,请分享。

谢谢。

Hello everyone,

i made one nice application in c# that download pdf files from websites.Now i want to make it to download some larger files like 50MB or more from servers/website. There is a problem when i try to download that file it only download 35KB of it. So my question is do you know anything about webclient in c# which can help me and solve my problem. I appreciate your time for reading this, and if you have any tut, link or smth else please share it.
Thank you.

推荐答案

最好不要使用 WebClient ,但 HttpWebReqiest

http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest%28v=vs.110%29.aspx [ ^ ]。



我在过去的回答中已经提供了HTTP下载器的完整源代码,除其他外,它可以继续下载未完全下载的文件,测试了许多在真正的大文件上。请参阅:如何从互联网上下载文件 [ ^ ]。



-SA
It's better to use not WebClient, but HttpWebReqiest:
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest%28v=vs.110%29.aspx[^].

I already provided, in my past answer, a complete source code for HTTP downloader which can, among other things, continue downloading of incompletely downloaded files, tested many times, on really big files. Please see: how to download a file from internet[^].

—SA


这篇关于C#中的WebClient,如何。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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