資源簡介
基于C#實現(xiàn)的簡單網(wǎng)絡嗅探器源碼,可以抓到本機上滿足指定IP地址的數(shù)據(jù)包,分析源,目的IP地址,源,目的端口,基礎協(xié)議類型以及16進制包數(shù)據(jù),對于學習C#和TCP/IP很有幫助。
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Threading.Tasks;
using?System.Windows.Forms;
using?System.Management;
using?System.Threading;
using?System.Net.Sockets;???
namespace?Sniffer
{
????public?partial?class?MainForm?:?Form
????{
????????public?MainForm()
????????{
????????????InitializeComponent();
????????}
????????//框架視圖加載時的操作
????????private?void?Sniffer_Load(object?sender?EventArgs?e)
????????{
????????????//Columns:控件中顯示的所有列標題的集合(需要View設置位Details)
????????????lvSniffInfo.Columns.Add(“協(xié)議“?60?System.Windows.Forms.HorizontalAlignment.Center);
????????????lvSniffInfo.Columns.Add(“源地址“?100?System.Windows.Forms.HorizontalAlignment.Center);
????????????lvSniffInfo.Columns.Add(“目的地址“?100?System.Windows.Forms.HorizontalAlignment.Center);
????????????lvSniffInfo.Columns.Add(“源端口“?60?System.Windows.Forms.HorizontalAlignmen
評論
共有 條評論