通过vb.net监视计算机输入/输出的数据 [英] Monitoring data in/out of the computer via vb.net

查看:96
本文介绍了通过vb.net监视计算机输入/输出的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用vb.net为Windows创建一个带宽计量器,但是我似乎无法在.net框架中找到用于监视输入或输出数据量的任何内容.我之所以要创建它,是因为我找不到免费的好东西,而我认为这是人们可能想要的东西.

I want to create a bandwidth meter for Windows using vb.net, but I cannot seem to find anything in the .net framework for monitoring the amount of data in or out. I want to create this because I cannot find a good one for free, and I think it is something that people might want.

如果.net框架中没有用于监视此内容的东西,是否可以进行一些P/Invoke调用?如果是这样,它们是什么?

If there is nothing in the .net framework for monitoring this, is there some P/Invoke calls I can make? If so, what are they?

该项目可行吗?我想尝试从所有程序和连接中尽可能准确地测量出入的数据量.

Is this project feasible? I want to try and measure the exact amount of data in and out, from ALL programs and connections if possible.

谢谢您的帮助!

为澄清起见,尽管我怀疑是否会出现诸如My.Computer.Network.IO之类的简单内容,但我真的不想使其变得过于复杂.

To clarify, while I doubt that there will be something simple like My.Computer.Network.IO or something like that, I don't really want to make this too complex.

再次也许这太复杂了.如果我只想监视端口80上的http活动,如何在不实际干扰数据的情况下做到这一点?

EDIT AGAIN: Perhaps this would be too complicated. If I simply wanted to monitor http activity on port 80, how could I do this without actually disturbing the data?

推荐答案

有几个性能计数器为您提供有关网络接口卡吞吐量的基本数字.首先使用Perfmon.exe查看它们,您将看到它们的类别,名称和实例名称. .NET PerformanceCounter类可以使用这些相同的数字.

There are several performance counters that give you basic numbers on throughput on the network interface card. Start by taking a look at them with Perfmon.exe, you'll see their category, name and instance name. Those same numbers are available with the .NET PerformanceCounter class.

使用它们来测量带宽是一件相当棘手的事情,您更有可能测量正在与之通信的服务器的带宽,再加上十几个将IP消息通过管道传输到您的计算机的路由器.

Using them to measure bandwidth is a rather tricky, you are more likely to measure the bandwidth of the server you are talking to, combined with the dozen or so routers that pipe the IP message to your machine.

这篇关于通过vb.net监视计算机输入/输出的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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