资源简介
(1) 捕获网络中的IP数据包,解析数据包的内容,并将结果显示出来。
(2) 显示内容包括:捕获的IP包的版本、源地址、目的地址、源端口、目的端口、协议类型、IP包总长度、IP包头总长度、IP数据包长度等内容。
(3) 设置停止标志,当程序接受到停止命令时即停止。

代码片段和文件信息
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;
using System.Management;
using System.Threading;
using System.IO;
namespace SimpleSniff
{
public class SniffWindow : System.Windows.Forms.Form
{
private System.Windows.Forms.ListBox resultListBox;
private System.Windows.Forms.Button startButton;
private System.Windows.Forms.Button stopButton;
private System.Windows.Forms.ComboBox addressComboBox;
private System.ComponentModel.Container components = null;
private System.Windows.Forms.Button clearButton;
private Label label1;
private Label label2;
private Label label3;
private Label label4;
private Button saveButton;
private Label label5;
private SniffSocket mySniffSocket;
public SniffWindow()
{
InitializeComponent();
}
protected override void Dispose(bool disposing) //为 true 则释放托管资源和非托管资源;为 false 则仅释放非托管资源。
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.resultListBox = new System.Windows.Forms.ListBox();
this.startButton = new System.Windows.Forms.Button();
this.stopButton = new System.Windows.Forms.Button();
this.addressComboBox = new System.Windows.Forms.ComboBox();
this.clearButton = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.saveButton = new System.Windows.Forms.Button();
this.label5 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// resultListBox
//
this.resultListBox.ItemHeight = 12;
this.resultListBox.Location = new System.Drawing.Point(4 35);
this.resultListBox.Name = “resultListBox“;
this.resultListBox.Size = new System.Drawing.Size(552 280);
this.resultListBox.TabIndex = 0;
this.resultListBox.DoubleClick += new System.EventHandler(this.resultListBox_DoubleClick);
//
// startButton
//
this.startButton.Location = new System.Drawing.Point(12 331);
this.startButton.Name = “startButton“;
this.startButton.Size = new System.Drawing.Size(75 23);
this.startButton.TabIndex = 1;
this.startButton.Te
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
..A..H. 47616 2018-01-05 10:19 SniffScoket\.vs\SIMPLESNIFF\v14\.suo
文件 369 2009-06-13 20:48 SniffScoket\APP.CS
文件 1078 2002-06-29 12:23 SniffScoket\APP.ICO
文件 2426 2002-06-29 12:23 SniffScoket\ASSEMBLYINFO.CS
文件 32768 2018-01-04 17:26 SniffScoket\BIN\DEBUG\SimpleSniff.exe
文件 42496 2018-01-04 17:26 SniffScoket\BIN\DEBUG\SimpleSniff.pdb
文件 21680 2018-01-05 09:38 SniffScoket\BIN\DEBUG\SimpleSniff.vshost.exe
文件 490 2016-07-16 19:44 SniffScoket\BIN\DEBUG\SimpleSniff.vshost.exe.manifest
文件 28672 2009-06-13 21:13 SniffScoket\BIN\RELEASE\SimpleSniff.exe
文件 5632 2005-12-08 14:51 SniffScoket\BIN\RELEASE\SimpleSniff.vshost.exe
文件 2238 2009-06-13 20:08 SniffScoket\ClassDiagram1.cd
文件 11850 2018-01-04 17:04 SniffScoket\MainForm.cs
文件 5814 2018-01-04 17:04 SniffScoket\MainForm.resx
文件 1230 2018-01-01 22:33 SniffScoket\OBJ\DEBUG\DesignTimeResolveAssemblyReferences.cache
文件 6184 2018-01-05 09:38 SniffScoket\OBJ\DEBUG\DesignTimeResolveAssemblyReferencesInput.cache
文件 847 2018-01-05 09:38 SniffScoket\OBJ\DEBUG\SimpleSniff.csproj.FileListAbsolute.txt
文件 843 2018-01-04 17:22 SniffScoket\OBJ\DEBUG\SimpleSniff.csproj.GenerateResource.Cache
文件 1340 2018-01-01 21:06 SniffScoket\OBJ\DEBUG\SimpleSniff.csprojResolveAssemblyReference.cache
文件 32768 2018-01-04 17:26 SniffScoket\OBJ\DEBUG\SimpleSniff.exe
文件 180 2018-01-04 17:22 SniffScoket\OBJ\DEBUG\SimpleSniff.PacketDisplay.resources
文件 42496 2018-01-04 17:26 SniffScoket\OBJ\DEBUG\SimpleSniff.pdb
文件 180 2018-01-04 17:14 SniffScoket\OBJ\DEBUG\SimpleSniff.SniffWindow.resources
文件 838 2009-06-13 21:13 SniffScoket\OBJ\RELEASE\SimpleSniff.csproj.GenerateResource.Cache
文件 28672 2009-06-13 21:13 SniffScoket\OBJ\RELEASE\SimpleSniff.exe
文件 180 2009-06-13 21:13 SniffScoket\OBJ\RELEASE\SimpleSniff.PacketDisplay.resources
文件 180 2009-06-13 21:13 SniffScoket\OBJ\RELEASE\SimpleSniff.SniffWindow.resources
文件 1227 2009-07-08 15:31 SniffScoket\OBJ\SimpleSniff.csproj.FileListAbsolute.txt
文件 15170 2018-01-04 17:26 SniffScoket\PacketDisplay.cs
文件 5814 2018-01-04 17:22 SniffScoket\PacketDisplay.resx
文件 5584 2018-01-01 21:01 SniffScoket\SIMPLESNIFF.CSPROJ
............此处省略27个文件信息
相关资源
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
- 基于c#的实验室设备管理系统621530
- C# 使用ListView控件实现图片浏览器(源
- C#简单窗体聊天程序
- C#指纹识别系统程序 报告
- c# 高校档案信息管理系统
- c#向word文件插入图片
- C#左侧导航菜单(动态生成)
评论
共有 条评论