zoukankan      html  css  js  c++  java
  • C#获得网络连接信息 IPGlobalProperties

    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

  • 相关阅读:
    限制字数输出,,超出的用...
    tablesorter 的使用
    二维数组根据某个特定字段排序
    对维数组排序 array_multisort()的应用
    多个字段关键字查询
    CASE WHEN用法
    type="submit" button的用法
    获取近30天的数据的时间方式
    练习题
    管理经济学第九章
  • 原文地址:https://www.cnblogs.com/2Yous/p/5797751.html
Copyright © 2011-2022 走看看