Skip to main content
 首页 » 编程设计

c#之如何检查 HttpWebRequest 上传的进度

2024年01月12日28dflying

我想知道如何检查已上传/下载了多少文件?我正在使用 HttpWebRequest

请您参考如下方法:

如果在 HttpWebRequest 上使用异步模式,您就可以做到这一点 - 有一个工作示例(基于 MSDN 文档示例代码)here .简要说明:

Here’s a little Win Forms client that allows you to download a single file from a server, using either HTTP or FTP. It shows download progress and displays the average transfer rate, in kb/sec. It also demonstrates how to use the HttpWebRequest and FtpWebRequest classes in System.Net to do file downloads.