获取C#中的网站下载和上传量 [英] Get the Download and Upload volume of a web site in C#
本文介绍了获取C#中的网站下载和上传量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我通过笔记本电脑连接到我的wifi网络,所以我的任务是通过C#获取网站的下载和上传量?? (例如:网站:www.youtube.com - ulpoad:1254-下载:25415)
祝你好运
Yassine
Hi,
I'm connected to my wifi network through my Laptop, so my task is to obtain the download and the Upload volume of a Website with C# ?? ( for example: Web site: www.youtube.com - ulpoad: 1254 - download: 25415)
Best regards
Yassine
推荐答案
使用 HttpWebRequest.Headers [ ^ ]来构成标题。
和HttpWebRequest.ContentLength [ ^ ],其中获取或设置Content-length HTTP标头
Use HttpWebRequest.Headers[^] to make up headers.
And HttpWebRequest.ContentLength[^], whichGets or sets the Content-length HTTP header
您好,
您可能会发现以下文章很有用。您真正想要实现的目标是访问网络数据包。捕获数据包后,您可以确定它是否为http数据包,如果是,则继续进行分析并计算上传和下载的字节数。
- RawSocket Class-Create网络监控(数据包嗅探)应用程序 [ ^ ]
- SharpPcap - 用于.NET的数据包捕获框架 [ ^ ]
- C#中的网络嗅探器 [ ^ ]
- 网络嗅探器和连接分析器 [ ^ ]
Hello,
You might find following articles useful. What you are really trying to achieve requires access to a network packet. Once a packet is captured then you can determine whether it's a http packet and if so then proceed with your analysis and compute the number of bytes uploaded and downloaded.
- RawSocket Class-Create Network Monitoring (Packet Sniffing) Apps[^]
- SharpPcap - A Packet Capture Framework for .NET[^]
- A Network Sniffer in C#[^]
- Network Sniffer and Connection Analyzer[^]
这篇关于获取C#中的网站下载和上传量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文