using System;
using System.Collections.Generic;
using System.Net.NetworkInformation; public class MyClass
{
public static void Main()
{
//Host Info
IPGlobalProperties ipProp = IPGlobalProperties.GetIPGlobalProperties();
string hostInfo =
string.Format("Host Name:{0}\nDomain Name:{1}\n\n",ipProp.HostName,ipProp.DomainName);
//statistics
IPGlobalStatistics ipStat = ipProp.GetIPv4GlobalStatistics();
TcpConnectionInformation[] tcpConns = ipProp.GetActiveTcpConnections();
string stat="";
foreach(TcpConnectionInformation info in tcpConns)
stat += string.Format("localhost:{0}\t{1}:{2}\tstate:{3}", info.LocalEndPoint.Port,
info.RemoteEndPoint.Address,info.RemoteEndPoint.Port, info.State);
//Network Interface
string niInfo="";
NetworkInterface[] nis = NetworkInterface.GetAllNetworkInterfaces();
foreach(NetworkInterface ni in nis)
niInfo += string.Format("\n\nName:{0}\nStatus:{1}\nSpeed:{2}\nMAC:{3}",
ni.Name,ni.OperationalStatus,ni.Speed,ni.GetPhysicalAddress()); System.Windows.Forms.MessageBox.Show(hostInfo + niInfo);
System.Windows.Forms.MessageBox.Show(stat);
Console.ReadKey();
}
}

最新文章

  1. jsp通过易宝方式实现在线支付
  2. 请问MVC4是不是类似于html页+ashx页之间用JSON通过AJAX交换数据这种方式、?
  3. jar包合并
  4. Android SDK打包
  5. 希尔排序(C++版)
  6. 详细说明svn分支与合并---命令行
  7. OpenXML操作word
  8. vim命令总结
  9. Phpwind v9.0 存储型xss跨站漏洞
  10. 【转】ubuntu连接android设备(附最简单方法)
  11. python学习第八天 -- 迭代
  12. ViewDragHelper练习使用
  13. 调用微信退款接口时,证书验证出现System.Security.Cryptography.CryptographicException: 出现了内部错误 解决办法
  14. 基于Handler架构的录音程序
  15. 2018-2019-2 网络对抗技术 20165316 Exp4 恶意代码分析
  16. 关于SVD
  17. Java如何创建参数个数不限的函数
  18. 【cocos2d-x 3.0-Mac配置篇】
  19. php 分享一个object(stdclass)转数组的函数
  20. Floyd模板(详细操作最基础版)

热门文章

  1. 转自一个CG大神的文章
  2. HTML5获取地理位置
  3. Ubuntu配置VNC server
  4. [NOIP2013] 火柴排队(归并排序)
  5. 之前想搞一个nim但因为是自用我会持续修复完善
  6. AJAX 的简单用法:
  7. WIN7 WIN8 WIN10你们的WmiPrvSE.exe系统占用资源厉害吗?
  8. Android 从图库到选择图片onActivityResult接收注意的问题
  9. dw的流体网格布局
  10. Python之路,day7-Python基础