0

我正在尝试获取网络流量的 URL,即用户通过使用 c# 中的 NetworkInterface 浏览的网站。我能够通过以下代码获得总字节数:

我正在寻找通过 URL 获取网络流量的方法。

if (!NetworkInterface.GetIsNetworkAvailable())
                return;

            NetworkInterface[] interfaces
                = NetworkInterface.GetAllNetworkInterfaces();

            foreach (NetworkInterface ni in interfaces)
            {
                Console.WriteLine("    Bytes Sent: {0}",
                    ni.GetIPv4Statistics().BytesSent);
                Console.WriteLine("    Bytes Received: {0}",
                    ni.GetIPv4Statistics().BytesReceived);
            }
4

0 回答 0