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

📄 capturedisplay.cs

📁 一个抓包工具
💻 CS
📖 第 1 页 / 共 2 页
字号:
			this.LblARP.Size = new System.Drawing.Size(28, 13);
			this.LblARP.TabIndex = 16;
			this.LblARP.Text = "ARP";
			// 
			// LblOSPF
			// 
			this.LblOSPF.AutoSize = true;
			this.LblOSPF.Location = new System.Drawing.Point(16, 120);
			this.LblOSPF.Name = "LblOSPF";
			this.LblOSPF.Size = new System.Drawing.Size(36, 13);
			this.LblOSPF.TabIndex = 15;
			this.LblOSPF.Text = "OSPF";
			// 
			// LblICMPCount
			// 
			this.LblICMPCount.AutoSize = true;
			this.LblICMPCount.Location = new System.Drawing.Point(88, 88);
			this.LblICMPCount.Name = "LblICMPCount";
			this.LblICMPCount.Size = new System.Drawing.Size(11, 13);
			this.LblICMPCount.TabIndex = 14;
			this.LblICMPCount.Text = "0";
			// 
			// LblICMPPct
			// 
			this.LblICMPPct.AutoSize = true;
			this.LblICMPPct.Location = new System.Drawing.Point(136, 88);
			this.LblICMPPct.Name = "LblICMPPct";
			this.LblICMPPct.Size = new System.Drawing.Size(55, 13);
			this.LblICMPPct.TabIndex = 13;
			this.LblICMPPct.Text = "( 0.00 % )";
			// 
			// LblUDPCount
			// 
			this.LblUDPCount.AutoSize = true;
			this.LblUDPCount.Location = new System.Drawing.Point(88, 72);
			this.LblUDPCount.Name = "LblUDPCount";
			this.LblUDPCount.Size = new System.Drawing.Size(11, 13);
			this.LblUDPCount.TabIndex = 12;
			this.LblUDPCount.Text = "0";
			// 
			// LblICMP
			// 
			this.LblICMP.AutoSize = true;
			this.LblICMP.Location = new System.Drawing.Point(16, 88);
			this.LblICMP.Name = "LblICMP";
			this.LblICMP.Size = new System.Drawing.Size(33, 13);
			this.LblICMP.TabIndex = 11;
			this.LblICMP.Text = "ICMP";
			// 
			// LblUDPPct
			// 
			this.LblUDPPct.AutoSize = true;
			this.LblUDPPct.Location = new System.Drawing.Point(136, 72);
			this.LblUDPPct.Name = "LblUDPPct";
			this.LblUDPPct.Size = new System.Drawing.Size(55, 13);
			this.LblUDPPct.TabIndex = 10;
			this.LblUDPPct.Text = "( 0.00 % )";
			// 
			// LblUDP
			// 
			this.LblUDP.AutoSize = true;
			this.LblUDP.Location = new System.Drawing.Point(16, 72);
			this.LblUDP.Name = "LblUDP";
			this.LblUDP.Size = new System.Drawing.Size(29, 13);
			this.LblUDP.TabIndex = 9;
			this.LblUDP.Text = "UDP";
			// 
			// LblTCPPct
			// 
			this.LblTCPPct.AutoSize = true;
			this.LblTCPPct.Location = new System.Drawing.Point(136, 56);
			this.LblTCPPct.Name = "LblTCPPct";
			this.LblTCPPct.Size = new System.Drawing.Size(55, 13);
			this.LblTCPPct.TabIndex = 8;
			this.LblTCPPct.Text = "( 0.00 % )";
			// 
			// LblTCPCount
			// 
			this.LblTCPCount.AutoSize = true;
			this.LblTCPCount.Location = new System.Drawing.Point(88, 56);
			this.LblTCPCount.Name = "LblTCPCount";
			this.LblTCPCount.Size = new System.Drawing.Size(11, 13);
			this.LblTCPCount.TabIndex = 7;
			this.LblTCPCount.Text = "0";
			// 
			// LblSCPTPct
			// 
			this.LblSCPTPct.AutoSize = true;
			this.LblSCPTPct.Location = new System.Drawing.Point(136, 40);
			this.LblSCPTPct.Name = "LblSCPTPct";
			this.LblSCPTPct.Size = new System.Drawing.Size(55, 13);
			this.LblSCPTPct.TabIndex = 6;
			this.LblSCPTPct.Text = "( 0.00 % )";
			// 
			// LblTCP
			// 
			this.LblTCP.AutoSize = true;
			this.LblTCP.Location = new System.Drawing.Point(16, 56);
			this.LblTCP.Name = "LblTCP";
			this.LblTCP.Size = new System.Drawing.Size(27, 13);
			this.LblTCP.TabIndex = 5;
			this.LblTCP.Text = "TCP";
			// 
			// LblSCPTCount
			// 
			this.LblSCPTCount.AutoSize = true;
			this.LblSCPTCount.Location = new System.Drawing.Point(88, 40);
			this.LblSCPTCount.Name = "LblSCPTCount";
			this.LblSCPTCount.Size = new System.Drawing.Size(11, 13);
			this.LblSCPTCount.TabIndex = 4;
			this.LblSCPTCount.Text = "0";
			// 
			// LblSCPT
			// 
			this.LblSCPT.AutoSize = true;
			this.LblSCPT.Location = new System.Drawing.Point(16, 40);
			this.LblSCPT.Name = "LblSCPT";
			this.LblSCPT.Size = new System.Drawing.Size(35, 13);
			this.LblSCPT.TabIndex = 3;
			this.LblSCPT.Text = "SCTP";
			// 
			// LblTotalPct
			// 
			this.LblTotalPct.AutoSize = true;
			this.LblTotalPct.Location = new System.Drawing.Point(136, 24);
			this.LblTotalPct.Name = "LblTotalPct";
			this.LblTotalPct.Size = new System.Drawing.Size(55, 13);
			this.LblTotalPct.TabIndex = 2;
			this.LblTotalPct.Text = "( 0.00 % )";
			// 
			// LblTotalCount
			// 
			this.LblTotalCount.AutoSize = true;
			this.LblTotalCount.Location = new System.Drawing.Point(88, 24);
			this.LblTotalCount.Name = "LblTotalCount";
			this.LblTotalCount.Size = new System.Drawing.Size(11, 13);
			this.LblTotalCount.TabIndex = 1;
			this.LblTotalCount.Text = "0";
			// 
			// LblTotal
			// 
			this.LblTotal.AutoSize = true;
			this.LblTotal.Location = new System.Drawing.Point(16, 24);
			this.LblTotal.Name = "LblTotal";
			this.LblTotal.Size = new System.Drawing.Size(31, 13);
			this.LblTotal.TabIndex = 0;
			this.LblTotal.Text = "Total";
			// 
			// GrpBoxRunningTime
			// 
			this.GrpBoxRunningTime.Controls.AddRange(new System.Windows.Forms.Control[] {
																							this.LblRunningTime});
			this.GrpBoxRunningTime.Location = new System.Drawing.Point(8, 296);
			this.GrpBoxRunningTime.Name = "GrpBoxRunningTime";
			this.GrpBoxRunningTime.Size = new System.Drawing.Size(224, 40);
			this.GrpBoxRunningTime.TabIndex = 1;
			this.GrpBoxRunningTime.TabStop = false;
			// 
			// LblRunningTime
			// 
			this.LblRunningTime.Location = new System.Drawing.Point(8, 16);
			this.LblRunningTime.Name = "LblRunningTime";
			this.LblRunningTime.Size = new System.Drawing.Size(208, 16);
			this.LblRunningTime.TabIndex = 0;
			this.LblRunningTime.Text = "00:00:00";
			this.LblRunningTime.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// BtnStop
			// 
			this.BtnStop.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.BtnStop.Location = new System.Drawing.Point(8, 344);
			this.BtnStop.Name = "BtnStop";
			this.BtnStop.Size = new System.Drawing.Size(224, 32);
			this.BtnStop.TabIndex = 2;
			this.BtnStop.Text = "Start";
			this.BtnStop.Click += new System.EventHandler(this.BtnStop_Click);
			// 
			// CaptureTimer
			// 
			this.CaptureTimer.Interval = 10;
			this.CaptureTimer.Tick += new System.EventHandler(this.CaptureTimer_Tick);
			// 
			// GrpBoxReadBytes
			// 
			this.GrpBoxReadBytes.Controls.AddRange(new System.Windows.Forms.Control[] {
																						  this.LblBytesRead});
			this.GrpBoxReadBytes.Location = new System.Drawing.Point(8, 248);
			this.GrpBoxReadBytes.Name = "GrpBoxReadBytes";
			this.GrpBoxReadBytes.Size = new System.Drawing.Size(224, 40);
			this.GrpBoxReadBytes.TabIndex = 3;
			this.GrpBoxReadBytes.TabStop = false;
			// 
			// LblBytesRead
			// 
			this.LblBytesRead.Location = new System.Drawing.Point(8, 16);
			this.LblBytesRead.Name = "LblBytesRead";
			this.LblBytesRead.Size = new System.Drawing.Size(208, 16);
			this.LblBytesRead.TabIndex = 0;
			this.LblBytesRead.Text = "0 bytes so far";
			this.LblBytesRead.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// CaptureDisplay
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 13);
			this.ClientSize = new System.Drawing.Size(240, 389);
			this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.GrpBoxReadBytes,
																		  this.BtnStop,
																		  this.GrpBoxRunningTime,
																		  this.GrpBoxCapture});
			this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.Name = "CaptureDisplay";
			this.Text = "CaptureDisplay - r.ysie.ysse.ysmu.r.bb";
			this.GrpBoxCapture.ResumeLayout(false);
			this.GrpBoxRunningTime.ResumeLayout(false);
			this.GrpBoxReadBytes.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion


		public void InitDisplay()
		{
			LblTotalCount.Text = "0";
			LblTotalPct.Text = "( 0.00 % )";

			LblSCPTCount.Text = "0";
			LblSCPTPct.Text = "( 0.00 % )";

			LblTCPCount.Text = "0";
			LblTCPPct.Text = "( 0.00 % )";

			LblUDPCount.Text = "0";
			LblUDPPct.Text = "( 0.00 % )";

			LblICMPCount.Text = "0";
			LblICMPPct.Text = "( 0.00 % )";

			LblARPCount.Text = "0";
			LblARPPct.Text = "( 0.00 % )";

			LblOSPFCount.Text = "0";
			LblOSPFPct.Text = "( 0.00 % )";

			LblGRECount.Text = "0";
			LblGREPct.Text = "( 0.00 % )";

			LblNetBIOSCount.Text = "0";
			LblNetBIOSPct.Text = "( 0.00 % )";

			LblIPXCount.Text = "0";
			LblIPXPct.Text = "( 0.00 % )";

			LblVINESCount.Text = "0";
			LblVINESPct.Text = "( 0.00 % )";

			LblOtherCount.Text = "0";
			LblOtherPct.Text = "( 0.00 % )";

			LblBytesRead.Text = "0 bytes read so far";
			LblRunningTime.Text = "00:00:00";
		}

		private void BtnStop_Click(object sender, System.EventArgs e)
		{
		
			if( BtnStop.Text == "Start" )
			{
				BtnStop.Text = "Stop";
				IsTimerRunning = false;
				CaptureTimer.Enabled = true;
				P32.Start( LVw , Tnc , Rtx );
			}
			else if( BtnStop.Text == "Stop" )
			{
				P32.StopCapture = true;
				CaptureTimer.Enabled = false;
				BtnStop.Text = "Start";
				this.Hide();
			}

			this.Hide();

		}

		private void CaptureTimer_Tick(object sender, System.EventArgs e)
		{
			if( IsTimerRunning ) return;

			IsTimerRunning = true;

			Application.DoEvents();

			LblTotalCount.Text = P32.CaptureStatus.Total.CountStr;
			LblTotalPct.Text = P32.CaptureStatus.Total.PctStr;

			LblSCPTCount.Text = P32.CaptureStatus.SCPT.CountStr;
			LblSCPTPct.Text = P32.CaptureStatus.SCPT.PctStr;

			Application.DoEvents();

			LblTCPCount.Text = P32.CaptureStatus.TCP.CountStr;
			LblTCPPct.Text = P32.CaptureStatus.TCP.PctStr;

			LblUDPCount.Text = P32.CaptureStatus.UDP.CountStr;
			LblUDPPct.Text = P32.CaptureStatus.UDP.PctStr;

			Application.DoEvents();

			LblICMPCount.Text = P32.CaptureStatus.ICMP.CountStr;
			LblICMPPct.Text = P32.CaptureStatus.ICMP.PctStr;

			LblARPCount.Text = P32.CaptureStatus.ARP.CountStr;
			LblARPPct.Text = P32.CaptureStatus.ARP.PctStr;

			Application.DoEvents();

			LblOSPFCount.Text = P32.CaptureStatus.OSPF.CountStr;
			LblOSPFPct.Text = P32.CaptureStatus.OSPF.PctStr;

			LblGRECount.Text = P32.CaptureStatus.GRE.CountStr;
			LblGREPct.Text = P32.CaptureStatus.GRE.PctStr;

			Application.DoEvents();

			LblNetBIOSCount.Text = P32.CaptureStatus.NetBIOS.CountStr;
			LblNetBIOSPct.Text = P32.CaptureStatus.NetBIOS.PctStr;

			LblIPXCount.Text = P32.CaptureStatus.IPX.CountStr;
			LblIPXPct.Text = P32.CaptureStatus.IPX.PctStr;

			Application.DoEvents();

			LblVINESCount.Text = P32.CaptureStatus.VINES.CountStr;
			LblVINESPct.Text = P32.CaptureStatus.VINES.PctStr;

			LblOtherCount.Text = P32.CaptureStatus.Other.CountStr;
			LblOtherPct.Text = P32.CaptureStatus.Other.PctStr;

			Application.DoEvents();

			LblBytesRead.Text = P32.CaptureStatus.KilobytesStr + "  bytes read so far";
			LblRunningTime.Text = P32.CaptureStatus.SecondsStr;

			if( P32.CaptureStopped )
			{
				CaptureTimer.Enabled = false;
				BtnStop.Text = "Start";
				this.Hide();
			}

			IsTimerRunning = false;
		}

	}
}

⌨️ 快捷键说明

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