最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

C#實(shí)現(xiàn)TCP連接信息統(tǒng)計(jì)的方法

 更新時(shí)間:2015年07月03日 10:06:48   作者:程序猴  
這篇文章主要介紹了C#實(shí)現(xiàn)TCP連接信息統(tǒng)計(jì)的方法,可實(shí)現(xiàn)有效獲取TCP連接信息及連接狀態(tài)的功能,需要的朋友可以參考下

本文實(shí)例講述了C#實(shí)現(xiàn)TCP連接信息統(tǒng)計(jì)的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net.NetworkInformation;
namespace test2
{
  public partial class Form1 : Form
  {
    public Form1()
    {
      InitializeComponent();
    }
    private void Form1_Load(object sender, EventArgs e)
    {
      IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
      TcpConnectionInformation[] connections = properties.GetActiveTcpConnections();
      foreach (TcpConnectionInformation t in connections)
      {
        listBoxResult.Items.Add("本地端點(diǎn): " + t.LocalEndPoint.Address);
        listBoxResult.Items.Add("遠(yuǎn)程端點(diǎn): " + t.RemoteEndPoint.Address);
        listBoxResult.Items.Add("狀態(tài):" + t.State);
      }
    }
  }
}

希望本文所述對(duì)大家的C#程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論

河北区| 广州市| 武邑县| 吉安市| 曲松县| 麻栗坡县| 清徐县| 中西区| 连州市| 台南市| 闻喜县| 平罗县| 酉阳| 高碑店市| 子洲县| 外汇| 资阳市| 象山县| 漾濞| 隆昌县| 松阳县| 平阳县| 南丹县| 姚安县| 黑山县| 翁源县| 特克斯县| 双桥区| 东城区| 全椒县| 那坡县| 大余县| 米易县| 宿迁市| 龙岩市| 八宿县| 十堰市| 克山县| 万安县| 天等县| 黄石市|