⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 captureoptions.cs

📁 一个抓包工具
💻 CS
📖 第 1 页 / 共 3 页
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace MyClasses
{

	public class CaptureOptions : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.GroupBox GrpBoxCapture;
		private System.Windows.Forms.GroupBox GrpBoxDisplayOptions;
		private System.Windows.Forms.GroupBox GrpBoxCaptureLimits;
		private System.Windows.Forms.GroupBox GrpBoxNameResolution;
		private System.Windows.Forms.CheckBox ChkCaptureLimit;
		private System.Windows.Forms.CheckBox ChkCaptureMode;
		private System.Windows.Forms.TextBox TxtFilter;
		private System.Windows.Forms.CheckBox ChkDisplayOptionsRealTime;
		private System.Windows.Forms.CheckBox ChkDisplayOptionsAutomaticScroll;
		private System.Windows.Forms.CheckBox ChkCaptureLimitsPackets;
		private System.Windows.Forms.CheckBox ChkCaptureLimitsKiloBytes;
		private System.Windows.Forms.CheckBox ChkCaptureLimitsSeconds;
		private System.Windows.Forms.TextBox TxtCaptureLimitsPackets;
		private System.Windows.Forms.TextBox TxtCaptureLimitsKiloBytes;
		private System.Windows.Forms.TextBox TxtCaptureLimitsSeconds;
		private System.Windows.Forms.CheckBox ChkNameResolutionMAC;
		private System.Windows.Forms.CheckBox ChkNameResolutionNetwork;
		private System.Windows.Forms.CheckBox ChkNameResolutionTransport;
		private System.Windows.Forms.ComboBox CmbAdapter;
		private System.Windows.Forms.Button BtnOk;
		private System.Windows.Forms.Button BtnCancel;

		private System.ComponentModel.Container components = null;
		private System.Windows.Forms.TextBox TxtEachPacketSize;

		public Packet32.CAPTURE_LIMITS thisCaptureLimits;
		public Packet32.CAPTURE_OPTIONS thisCaptureOptions;
		public Packet32.DISPLAY_OPTIONS thisDisplayOptions;
		public Packet32.NAME_RESOLUTION thisNameResolution;
//		public Packet32 P32;

		private System.Windows.Forms.GroupBox GrpPacket;
		private System.Windows.Forms.Label label7;
		private System.Windows.Forms.Label label8;
		private System.Windows.Forms.Label label9;
		private System.Windows.Forms.Label label10;
		private System.Windows.Forms.TextBox TxtBufferSize;
		private System.Windows.Forms.TextBox TxtMinBytesToCopy;
		private System.Windows.Forms.TextBox TxtNumWrites;
		private System.Windows.Forms.TextBox TxtReadTimeOut;
		private System.Windows.Forms.Label label11;
		private System.Windows.Forms.TextBox TxtAdapterBufferSize;
		private System.Windows.Forms.Label label12;
		private System.Windows.Forms.Label label13;
		private System.Windows.Forms.ComboBox CmbCaptureMode;
		private System.Windows.Forms.CheckedListBox ChkBoxHardwareFilter;

		public string [] Adapters;

		public CaptureOptions()
		{

			InitializeComponent();

		}


		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.GrpBoxCapture = new System.Windows.Forms.GroupBox();
			this.CmbAdapter = new System.Windows.Forms.ComboBox();
			this.label6 = new System.Windows.Forms.Label();
			this.TxtFilter = new System.Windows.Forms.TextBox();
			this.label2 = new System.Windows.Forms.Label();
			this.ChkCaptureMode = new System.Windows.Forms.CheckBox();
			this.label1 = new System.Windows.Forms.Label();
			this.TxtEachPacketSize = new System.Windows.Forms.TextBox();
			this.ChkCaptureLimit = new System.Windows.Forms.CheckBox();
			this.GrpBoxDisplayOptions = new System.Windows.Forms.GroupBox();
			this.ChkDisplayOptionsAutomaticScroll = new System.Windows.Forms.CheckBox();
			this.ChkDisplayOptionsRealTime = new System.Windows.Forms.CheckBox();
			this.GrpBoxCaptureLimits = new System.Windows.Forms.GroupBox();
			this.label5 = new System.Windows.Forms.Label();
			this.label4 = new System.Windows.Forms.Label();
			this.label3 = new System.Windows.Forms.Label();
			this.TxtCaptureLimitsSeconds = new System.Windows.Forms.TextBox();
			this.TxtCaptureLimitsKiloBytes = new System.Windows.Forms.TextBox();
			this.TxtCaptureLimitsPackets = new System.Windows.Forms.TextBox();
			this.ChkCaptureLimitsSeconds = new System.Windows.Forms.CheckBox();
			this.ChkCaptureLimitsKiloBytes = new System.Windows.Forms.CheckBox();
			this.ChkCaptureLimitsPackets = new System.Windows.Forms.CheckBox();
			this.GrpBoxNameResolution = new System.Windows.Forms.GroupBox();
			this.ChkNameResolutionTransport = new System.Windows.Forms.CheckBox();
			this.ChkNameResolutionNetwork = new System.Windows.Forms.CheckBox();
			this.ChkNameResolutionMAC = new System.Windows.Forms.CheckBox();
			this.BtnOk = new System.Windows.Forms.Button();
			this.BtnCancel = new System.Windows.Forms.Button();
			this.GrpPacket = new System.Windows.Forms.GroupBox();
			this.ChkBoxHardwareFilter = new System.Windows.Forms.CheckedListBox();
			this.CmbCaptureMode = new System.Windows.Forms.ComboBox();
			this.label13 = new System.Windows.Forms.Label();
			this.label12 = new System.Windows.Forms.Label();
			this.TxtAdapterBufferSize = new System.Windows.Forms.TextBox();
			this.label11 = new System.Windows.Forms.Label();
			this.TxtReadTimeOut = new System.Windows.Forms.TextBox();
			this.TxtNumWrites = new System.Windows.Forms.TextBox();
			this.TxtMinBytesToCopy = new System.Windows.Forms.TextBox();
			this.TxtBufferSize = new System.Windows.Forms.TextBox();
			this.label10 = new System.Windows.Forms.Label();
			this.label9 = new System.Windows.Forms.Label();
			this.label8 = new System.Windows.Forms.Label();
			this.label7 = new System.Windows.Forms.Label();
			this.GrpBoxCapture.SuspendLayout();
			this.GrpBoxDisplayOptions.SuspendLayout();
			this.GrpBoxCaptureLimits.SuspendLayout();
			this.GrpBoxNameResolution.SuspendLayout();
			this.GrpPacket.SuspendLayout();
			this.SuspendLayout();
			// 
			// GrpBoxCapture
			// 
			this.GrpBoxCapture.Controls.AddRange(new System.Windows.Forms.Control[] {
																						this.CmbAdapter,
																						this.label6,
																						this.TxtFilter,
																						this.label2,
																						this.ChkCaptureMode,
																						this.label1,
																						this.TxtEachPacketSize,
																						this.ChkCaptureLimit});
			this.GrpBoxCapture.Location = new System.Drawing.Point(8, 8);
			this.GrpBoxCapture.Name = "GrpBoxCapture";
			this.GrpBoxCapture.Size = new System.Drawing.Size(712, 160);
			this.GrpBoxCapture.TabIndex = 0;
			this.GrpBoxCapture.TabStop = false;
			this.GrpBoxCapture.Text = "   Capture   ";
			// 
			// CmbAdapter
			// 
			this.CmbAdapter.Location = new System.Drawing.Point(72, 16);
			this.CmbAdapter.Name = "CmbAdapter";
			this.CmbAdapter.Size = new System.Drawing.Size(632, 21);
			this.CmbAdapter.TabIndex = 0;
			// 
			// label6
			// 
			this.label6.Location = new System.Drawing.Point(8, 24);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(56, 16);
			this.label6.TabIndex = 6;
			this.label6.Text = "Interface";
			// 
			// TxtFilter
			// 
			this.TxtFilter.Location = new System.Drawing.Point(48, 120);
			this.TxtFilter.Name = "TxtFilter";
			this.TxtFilter.Size = new System.Drawing.Size(656, 20);
			this.TxtFilter.TabIndex = 4;
			this.TxtFilter.Text = "";
			// 
			// label2
			// 
			this.label2.AutoSize = true;
			this.label2.Location = new System.Drawing.Point(8, 128);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(29, 13);
			this.label2.TabIndex = 4;
			this.label2.Text = "Filter";
			// 
			// ChkCaptureMode
			// 
			this.ChkCaptureMode.Location = new System.Drawing.Point(8, 96);
			this.ChkCaptureMode.Name = "ChkCaptureMode";
			this.ChkCaptureMode.Size = new System.Drawing.Size(216, 16);
			this.ChkCaptureMode.TabIndex = 3;
			this.ChkCaptureMode.Text = "Capture packets in promiscuous mode";
			// 
			// label1
			// 
			this.label1.AutoSize = true;
			this.label1.Location = new System.Drawing.Point(216, 72);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(34, 13);
			this.label1.TabIndex = 2;
			this.label1.Text = " bytes";
			// 
			// TxtEachPacketSize
			// 
			this.TxtEachPacketSize.Location = new System.Drawing.Point(144, 64);
			this.TxtEachPacketSize.Name = "TxtEachPacketSize";
			this.TxtEachPacketSize.Size = new System.Drawing.Size(64, 20);
			this.TxtEachPacketSize.TabIndex = 2;
			this.TxtEachPacketSize.Text = "68";
			// 
			// ChkCaptureLimit
			// 
			this.ChkCaptureLimit.Location = new System.Drawing.Point(8, 72);
			this.ChkCaptureLimit.Name = "ChkCaptureLimit";
			this.ChkCaptureLimit.Size = new System.Drawing.Size(128, 16);
			this.ChkCaptureLimit.TabIndex = 1;
			this.ChkCaptureLimit.Text = "Limit each packet to ";
			// 
			// GrpBoxDisplayOptions
			// 
			this.GrpBoxDisplayOptions.Controls.AddRange(new System.Windows.Forms.Control[] {
																							   this.ChkDisplayOptionsAutomaticScroll,
																							   this.ChkDisplayOptionsRealTime});
			this.GrpBoxDisplayOptions.Location = new System.Drawing.Point(8, 176);
			this.GrpBoxDisplayOptions.Name = "GrpBoxDisplayOptions";
			this.GrpBoxDisplayOptions.Size = new System.Drawing.Size(400, 72);
			this.GrpBoxDisplayOptions.TabIndex = 1;
			this.GrpBoxDisplayOptions.TabStop = false;
			this.GrpBoxDisplayOptions.Text = "   Display Options   ";
			// 
			// ChkDisplayOptionsAutomaticScroll
			// 
			this.ChkDisplayOptionsAutomaticScroll.Location = new System.Drawing.Point(8, 48);
			this.ChkDisplayOptionsAutomaticScroll.Name = "ChkDisplayOptionsAutomaticScroll";
			this.ChkDisplayOptionsAutomaticScroll.Size = new System.Drawing.Size(192, 16);
			this.ChkDisplayOptionsAutomaticScroll.TabIndex = 6;
			this.ChkDisplayOptionsAutomaticScroll.Text = "Automatic scrolling in live capture";
			// 
			// ChkDisplayOptionsRealTime
			// 
			this.ChkDisplayOptionsRealTime.Location = new System.Drawing.Point(8, 24);
			this.ChkDisplayOptionsRealTime.Name = "ChkDisplayOptionsRealTime";
			this.ChkDisplayOptionsRealTime.Size = new System.Drawing.Size(208, 16);
			this.ChkDisplayOptionsRealTime.TabIndex = 5;
			this.ChkDisplayOptionsRealTime.Text = "Update the list of packets in real time";
			// 
			// GrpBoxCaptureLimits
			// 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -