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

  • 相关阅读:
    Lucene
    SQL优化以及索引
    Mysql优化
    RocketMQ
    RocketMQ
    Session共享
    Linux安装Nginx
    初识nginx
    跨域,防止表单重复提交
    HttpClient案例
  • 原文地址:https://www.cnblogs.com/2Yous/p/5797751.html
Copyright © 2011-2022 走看看