首页 > Windows开发 > 详细

C#的IPGlobalProperties

时间:2016-08-23 01:11:56      阅读:335      评论:0      收藏:0      [点我收藏+]

IPGlobalProperties 提供有关本地计算机的网络连接的信息。

此类提供有关本地计算机的网络接口和网络连接的配置和统计信息 可以获取本机TCP UDP 丢包 发包等数据。

此类提供的信息与 IP Helper API 函数提供的信息相似。有关 IP Helper 的信息,请参见 MSDN Library 中的文档。

1             //得到本机Internet协议IPV4的统计数据;
2             IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
3             IPGlobalStatistics ipstat = properties.GetIPv4GlobalStatistics();
4             Console.WriteLine("  Inbound Packet Data:");
5             Console.WriteLine("      Received ............................ : {0}",ipstat.ReceivedPackets);
6             Console.WriteLine("      Forwarded ........................... : {0}",ipstat.ReceivedPacketsForwarded);
7             Console.WriteLine("      Delivered ........................... : {0}",ipstat.ReceivedPacketsDelivered);
8             Console.WriteLine("      Discarded ........................... : {0}",ipstat.ReceivedPacketsDiscarded);   

 

 

技术分享

https://msdn.microsoft.com/zh-cn/library/system.net.networkinformation.ipglobalproperties%28v=vs.110%29.aspx

C#的IPGlobalProperties

原文:http://www.cnblogs.com/2Yous/p/5797751.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!