C# 监控互联网活动?

C# 监控互联网活动?,c#,C#,嗨,我正在使用c#开发一个窗口应用程序, 我想知道如何通过互联网活动或网站监控计算机活动。例如,您可能想查看“数据包嗅探”工具,或者-它们是开源的,具有命令行界面,因此您可以从程序中调用这些工具,并分析它可能生成的任何日志文件。数据包嗅探器扫描您的网络以查找发送的数据包,internet活动通常会捕获TCP和IP数据包,以便您可以筛选这些数据包,并查看它们从何处发送到何处。您可能需要查看“数据包嗅探器”工具,例如,or-它们是开源的,并且有命令行界面,因此您可以从程序中调用它们,并分析它可能生成

嗨,我正在使用c#开发一个窗口应用程序,
我想知道如何通过互联网活动或网站监控计算机活动。

例如,您可能想查看“数据包嗅探”工具,或者-它们是开源的,具有命令行界面,因此您可以从程序中调用这些工具,并分析它可能生成的任何日志文件。数据包嗅探器扫描您的网络以查找发送的数据包,internet活动通常会捕获TCP和IP数据包,以便您可以筛选这些数据包,并查看它们从何处发送到何处。

您可能需要查看“数据包嗅探器”工具,例如,or-它们是开源的,并且有命令行界面,因此您可以从程序中调用它们,并分析它可能生成的任何日志文件。数据包嗅探器扫描您的网络以查找发送的数据包,internet活动通常会捕获TCP和IP数据包,以便您可以筛选这些数据包并查看它们从何处发送/将要发送到何处。

我认为您应该查看System.Diagnostics.PerformanceCounter类。为了那个班

下面是一个在网络接口上每秒获取字节数的小代码片段

PerformanceCounterCategory category = new PerformanceCounterCategory("Network Interface");

// Look at GetInstanceNames() result to find you interface,  mine's 3 for example
string instance = category.GetInstanceNames()[0];

PerformanceCounter sent = new PerformanceCounter("Network Interface", "Bytes Sent/sec", instance);
PerformanceCounter received = new PerformanceCounter("Network Interface", "Bytes Received/sec", instance);

while (true)
{
     Console.WriteLine("Send {0}b/s\tReceive {1}b/s", sent.NextValue(), received.NextValue());
     Thread.Sleep(500);
}

我认为您应该看看System.Diagnostics.PerformanceCounter类。为了那个班

下面是一个在网络接口上每秒获取字节数的小代码片段

PerformanceCounterCategory category = new PerformanceCounterCategory("Network Interface");

// Look at GetInstanceNames() result to find you interface,  mine's 3 for example
string instance = category.GetInstanceNames()[0];

PerformanceCounter sent = new PerformanceCounter("Network Interface", "Bytes Sent/sec", instance);
PerformanceCounter received = new PerformanceCounter("Network Interface", "Bytes Received/sec", instance);

while (true)
{
     Console.WriteLine("Send {0}b/s\tReceive {1}b/s", sent.NextValue(), received.NextValue());
     Thread.Sleep(500);
}

您可以使用sharpPcap,它是.Net的数据包捕获框架 这个库有很多有用的功能来监控数据包,
您可以过滤HTTP数据包。

您可以使用sharpPcap,它是.Net的数据包捕获框架 这个库有很多有用的功能来监控数据包,
你可以过滤HTTP数据包。

呃,我们在2006年将Ethereal的名字改为Wireshark()。@Gerald:那么谁在www.etreal.com?呃,我们在2006年将Ethereal的名字改为Wireshark()。@Gerald:那么谁在www.etreal.com?