whuanle / CZGL.SystemInfo

一个.NET Core监控系统CPU内存等信息的工具
353 stars 68 forks source link

nuget包中,没有网络流量的获取方法或者相关方法无效 #13

Closed mfjiang closed 2 years ago

mfjiang commented 2 years ago
                var networks = NetworkInfo.GetRealNetworkInfos();
                for (int i = 0; i < networks.Length; i++)
                {
                    data.Add($"net_work_{i + 1}_ipv4", (networks[i].AddressIpv4.ToString()));
                    data.Add($"net_work_{i + 1}_ipv6", (networks[i].AddressIpv6.ToString()));
                    data.Add($"net_work_{i + 1}_total_up_kb", (networks[i].Ipv4Statistics.BytesSent / 1024).ToString());
                    data.Add($"net_work_{i + 1}_total_down_kb", (networks[i].Ipv4Statistics.BytesReceived / 1024).ToString());
                    InternetSpeed speed = new InternetSpeed();
                    networks[i].GetInternetSpeed(ref speed,1000);
                    data.Add($"net_work_{i + 1}_down_kb", (speed.Received.OriginSize / 1024).ToString());
                    data.Add($"net_work_{i + 1}_up_kb", (speed.Sent.OriginSize / 1024).ToString());
                }

以上代码,speed.Received.OriginSize , speed.Sent.OriginSize 皆是0,请问要怎么取?

nuget 包版本:1.0.3

whuanle commented 2 years ago

抱歉,这部分有bug,我计划改,比较忙,这边没有动手

whuanle commented 2 years ago

计划这周花时间升级到 .net 6,然后写window、linux支持

mfjiang commented 2 years ago

计划这周花时间升级到 .net 6,然后写window、linux支持

3.1 希望也能修复