简体   繁体   English

如何使用C#在Windows XP / 2003/2008上实时测量每个进程的上载和下载带宽利用率?

[英]How do I measure the upload and download bandwidth utilization per each process on windows xp/2003/2008 in realtime using C#?

如何使用C#在Windows XP / 2003/2008上实时测量每个进程的上载和下载带宽利用率?

Use one of these 2 libraries to capture packets : 使用以下两个库之一捕获数据包:

http://www.codeproject.com/KB/cs/pacanal.aspx http://www.codeproject.com/KB/cs/pacanal.aspx

or 要么

http://www.codeproject.com/KB/cs/pktcap.aspx http://www.codeproject.com/KB/cs/pktcap.aspx

. Then: 然后:

  • Capture all packets 捕获所有数据包
  • For each packet, get the associated process 对于每个数据包,获取相关的过程
  • With the packet length and the current time, for each process, you'll be able to compute the bandwidth used. 使用数据包的长度和当前时间,对于每个进程,您将能够计算所使用的带宽。

In fact, once you manage to capture the packets, and associate them to a process, it's done. 实际上,一旦您成功捕获了数据包并将它们与流程相关联,就完成了。 Then all you have to do is a bit of algebra. 然后,您要做的只是一点代数。

There may be other solutions, but that's the only one I can think of right now. 可能还有其他解决方案,但这是我目前唯一想到的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何通过c#在Windows XP上测量Windows XP到Windows 8的上传和下载网络利用率? - how do measure upload and download Network utilization by Process on Windows XP to Windows 8 in c#? 如何以编程方式使用 C#/VB.Net 以 MB 为单位测量网站带宽(上传+下载)? - How to measure a Website Bandwidth (Upload+Download) in MB using C#/VB.Net programmatically? C# - 使用网络带宽计算下载/上传时间 - C# -calculate download/upload time using network bandwidth 使用C#向Windows Server 2003/2008中的防火墙添加例外 - Adding exception to firewall in Windows Server 2003/2008 using C# 如何在c#中测量子进程启动时间? - How do I measure child process launch time in c#? 如何测量C#中每一行的执行时间 - How do I measure execution time for each row in C# 如何使用 C# 或免费的 XP 工具卸载或删除 Windows XP Sp3 游戏? - How can I uninstall or delete Windows XP Sp3 Games using C# or free XP tools? 如何获得每个进程的带宽? - How I can get the bandwidth per process? 在Windows XP上,如何枚举系统显示的所有窗口(C#) - On Windows XP, how do I enumerate all the windows displayed by the system (C#) 使用C#,如何在Windows Vista,7,2008中复制符号链接 - Using c#, how do I copy a symbolic link in Windows Vista,7,2008
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM