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

  • 相关阅读:
    第三章 kubernetes核心原理
    Jmeter
    Docker 入门学习
    第二章 Kuberbetes实践指南
    第一章 Kubernetes入门
    java中的引用与ThreadLocal
    Disruptor极速队列
    Redis设计与实现——单机数据库的实现
    Redis设计与实现——数据结构与对象
    python装饰器
  • 原文地址:https://www.cnblogs.com/2Yous/p/5797751.html
Copyright © 2011-2022 走看看