首页 > 解决方案 > 如何从网络流量中获取 URL

问题描述

我正在尝试获取网络流量的 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);
            }

标签: c#

解决方案


推荐阅读