快速高效? WebClient或FtpWebRequest [英] Fast and Efficient ? WebClient or FtpWebRequest

查看:317
本文介绍了快速高效? WebClient或FtpWebRequest的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





从服务器检索文件的以下哪种方法快速有效?



1- FtpWebRequest

2- WebClient



感谢您的时间。



问候。

Hi,

Which of the following method to retrieve a file from server is fast and efficient ?

1- FtpWebRequest
2- WebClient

Thanks for your time.

Regards.

推荐答案

它们都受到网络速度和流处理的限制。最重要的是,FtpWebRequest只能从FTP获取数据,而Web请求只能从Web服务器(http)获取,因此您使用哪一个取决于文件的位置而不是速度。






FtpWebRequest和WebClient.DownloadFile使用相同的基础类从互联网WebRequest下载数据。因此,两种方法在传输开始后完全相同。
They are both limited by network speed and YOUR handling of the stream. On top of that, FtpWebRequest can only get data from FTP's, and web request can only get them from a web server (http), so which one you use depends on where the file is located more than speed.



Both FtpWebRequest and WebClient.DownloadFile use the same underlying class to download data from the internet, WebRequest. So both methods are exactly the same after the transfer starts.


这篇关于快速高效? WebClient或FtpWebRequest的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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