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

  • 相关阅读:
    生信入门-爱课程上的华中农业大学
    PAT 1115 Counting Nodes in a BST[构建BST]
    PAT 1133 Splitting A Linked List[链表][简单]
    PAT 1037 Magic Coupon[dp]
    PAT 1033 To Fill or Not to Fill[dp]
    畅通工程续 HDU1874
    Free DIY Tour HDU1224
    六度分离 HDU1869
    Arbitrage HDU1217
    floyed算法
  • 原文地址:https://www.cnblogs.com/2Yous/p/5797751.html
Copyright © 2011-2022 走看看