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

📄 mainform.cs

📁 利用VS C#实现的网络爬虫功能
💻 CS
📖 第 1 页 / 共 5 页
字号:
		private System.Windows.Forms.MenuItem menuItemCut;
		private System.Windows.Forms.MenuItem menuItemDelete;
		private System.Windows.Forms.MenuItem menuItemSettingsAdvanced;
		private System.Windows.Forms.MenuItem menuItemAdvanced;
		private System.Windows.Forms.TabPage tabPageRequests;
		private System.Windows.Forms.Splitter splitter1;
		private System.Windows.Forms.ListView listViewRequests;
		private System.Windows.Forms.ColumnHeader columnHeader2;
		private System.Windows.Forms.ColumnHeader columnHeader3;
		private System.Windows.Forms.ColumnHeader columnHeader4;
		private System.Windows.Forms.TextBox textBoxRequest;
		private System.Windows.Forms.MenuItem menuItemHttp;
		private System.Windows.Forms.StatusBarPanel statusBarPanelCPU;
		private System.Windows.Forms.Timer timerConnectionInfo;
		private System.Windows.Forms.ImageList imageListPercentage;
		private System.Windows.Forms.StatusBarPanel statusBarPanelInfo;
		private System.Windows.Forms.StatusBarPanel statusBarPanelFiles;
		private System.Windows.Forms.StatusBarPanel statusBarPanelURLs;
		private System.Windows.Forms.MenuItem menuItem5;

		public CrawlerForm()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			this.urlStorage = new SortTree();
			this.threadsRun = new Thread[200];
			this.queueURLS = new Queue();
			this.cpuCounter = new System.Diagnostics.PerformanceCounter(); 
			this.ramCounter = new System.Diagnostics.PerformanceCounter("Memory", "Available MBytes"); 

			this.cpuCounter.CategoryName = "Processor"; 
			this.cpuCounter.CounterName = "% Processor Time"; 
			this.cpuCounter.InstanceName = "_Total"; 

		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			this.StopParsing();

			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );

			System.Environment.Exit(0);
		}

		#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.components = new System.ComponentModel.Container();
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(CrawlerForm));
			this.mainMenu = new System.Windows.Forms.MainMenu();
			this.menuItemFile = new System.Windows.Forms.MenuItem();
			this.menuItemExit = new System.Windows.Forms.MenuItem();
			this.menuItemOptions = new System.Windows.Forms.MenuItem();
			this.menuItemSettings = new System.Windows.Forms.MenuItem();
			this.menuItem1 = new System.Windows.Forms.MenuItem();
			this.menuItemFileMatches = new System.Windows.Forms.MenuItem();
			this.menuItemOutput = new System.Windows.Forms.MenuItem();
			this.menuItemConnections = new System.Windows.Forms.MenuItem();
			this.menuItemAdvanced = new System.Windows.Forms.MenuItem();
			this.menuItemHelp = new System.Windows.Forms.MenuItem();
			this.menuItemAbout = new System.Windows.Forms.MenuItem();
			this.toolBarMain = new System.Windows.Forms.ToolBar();
			this.toolBarButtonContinue = new System.Windows.Forms.ToolBarButton();
			this.toolBarButtonPause = new System.Windows.Forms.ToolBarButton();
			this.toolBarButtonStop = new System.Windows.Forms.ToolBarButton();
			this.toolBarButton1 = new System.Windows.Forms.ToolBarButton();
			this.toolBarButtonDeleteAll = new System.Windows.Forms.ToolBarButton();
			this.toolBarButton2 = new System.Windows.Forms.ToolBarButton();
			this.toolBarButtonSettings = new System.Windows.Forms.ToolBarButton();
			this.contextMenuSettings = new System.Windows.Forms.ContextMenu();
			this.menuItemSettingsFileMatches = new System.Windows.Forms.MenuItem();
			this.menuItemSettingsOutput = new System.Windows.Forms.MenuItem();
			this.menuItemSettingsConnections = new System.Windows.Forms.MenuItem();
			this.menuItemSettingsAdvanced = new System.Windows.Forms.MenuItem();
			this.imageList2 = new System.Windows.Forms.ImageList(this.components);
			this.statusBar = new System.Windows.Forms.StatusBar();
			this.statusBarPanelInfo = new System.Windows.Forms.StatusBarPanel();
			this.statusBarPanelURLs = new System.Windows.Forms.StatusBarPanel();
			this.statusBarPanelFiles = new System.Windows.Forms.StatusBarPanel();
			this.statusBarPanelByteCount = new System.Windows.Forms.StatusBarPanel();
			this.statusBarPanelErrors = new System.Windows.Forms.StatusBarPanel();
			this.statusBarPanelCPU = new System.Windows.Forms.StatusBarPanel();
			this.statusBarPanelMem = new System.Windows.Forms.StatusBarPanel();
			this.toolBarWeb = new System.Windows.Forms.ToolBar();
			this.toolBarButtonBrowse = new System.Windows.Forms.ToolBarButton();
			this.contextMenuBrowse = new System.Windows.Forms.ContextMenu();
			this.menuItemBrowseHttp = new System.Windows.Forms.MenuItem();
			this.menuItemHttp = new System.Windows.Forms.MenuItem();
			this.menuItem5 = new System.Windows.Forms.MenuItem();
			this.imageList4 = new System.Windows.Forms.ImageList(this.components);
			this.tabControlRightView = new System.Windows.Forms.TabControl();
			this.tabPageThreads = new System.Windows.Forms.TabPage();
			this.listViewThreads = new System.Windows.Forms.ListView();
			this.columnHeaderTHreadID = new System.Windows.Forms.ColumnHeader();
			this.columnHeaderThreadDepth = new System.Windows.Forms.ColumnHeader();
			this.columnHeaderThreadAction = new System.Windows.Forms.ColumnHeader();
			this.columnHeaderThreadURL = new System.Windows.Forms.ColumnHeader();
			this.columnHeaderThreadBytes = new System.Windows.Forms.ColumnHeader();
			this.columnHeaderThreadPersentage = new System.Windows.Forms.ColumnHeader();
			this.imageList3 = new System.Windows.Forms.ImageList(this.components);
			this.tabPageRequests = new System.Windows.Forms.TabPage();
			this.textBoxRequest = new System.Windows.Forms.TextBox();
			this.splitter1 = new System.Windows.Forms.Splitter();
			this.listViewRequests = new System.Windows.Forms.ListView();
			this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
			this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
			this.columnHeader4 = new System.Windows.Forms.ColumnHeader();
			this.tabPageErrors = new System.Windows.Forms.TabPage();
			this.textBoxErrorDescription = new System.Windows.Forms.TextBox();
			this.splitter3 = new System.Windows.Forms.Splitter();
			this.listViewErrors = new System.Windows.Forms.ListView();
			this.columnHeaderErrorID = new System.Windows.Forms.ColumnHeader();
			this.columnHeaderDate = new System.Windows.Forms.ColumnHeader();
			this.columnHeaderErrorItem = new System.Windows.Forms.ColumnHeader();
			this.columnHeaderErrorDescription = new System.Windows.Forms.ColumnHeader();
			this.comboBoxWeb = new System.Windows.Forms.ComboBox();
			this.contextMenuNavigate = new System.Windows.Forms.ContextMenu();
			this.menuItemCut = new System.Windows.Forms.MenuItem();
			this.menuItemCopy = new System.Windows.Forms.MenuItem();
			this.menuItemPaste = new System.Windows.Forms.MenuItem();
			this.menuItemDelete = new System.Windows.Forms.MenuItem();
			this.toolBarButton4 = new System.Windows.Forms.ToolBarButton();
			this.buttonGo = new System.Windows.Forms.Button();
			this.imageList1 = new System.Windows.Forms.ImageList(this.components);
			this.timerMem = new System.Windows.Forms.Timer(this.components);
			this.imageListPercentage = new System.Windows.Forms.ImageList(this.components);
			this.timerConnectionInfo = new System.Windows.Forms.Timer(this.components);
			((System.ComponentModel.ISupportInitialize)(this.statusBarPanelInfo)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.statusBarPanelURLs)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.statusBarPanelFiles)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.statusBarPanelByteCount)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.statusBarPanelErrors)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.statusBarPanelCPU)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.statusBarPanelMem)).BeginInit();
			this.tabControlRightView.SuspendLayout();
			this.tabPageThreads.SuspendLayout();
			this.tabPageRequests.SuspendLayout();
			this.tabPageErrors.SuspendLayout();
			this.SuspendLayout();
			// 
			// mainMenu
			// 
			this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																					 this.menuItemFile,
																					 this.menuItemOptions,
																					 this.menuItemHelp});
			// 
			// menuItemFile
			// 
			this.menuItemFile.Index = 0;
			this.menuItemFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																						 this.menuItemExit});
			this.menuItemFile.Text = "&File";
			// 
			// menuItemExit
			// 
			this.menuItemExit.Index = 0;
			this.menuItemExit.Shortcut = System.Windows.Forms.Shortcut.CtrlX;
			this.menuItemExit.Text = "E&xit";
			this.menuItemExit.Click += new System.EventHandler(this.menuItemExit_Click);
			// 
			// menuItemOptions
			// 
			this.menuItemOptions.Index = 1;
			this.menuItemOptions.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																							this.menuItemSettings,
																							this.menuItem1,
																							this.menuItemFileMatches,
																							this.menuItemOutput,
																							this.menuItemConnections,
																							this.menuItemAdvanced});
			this.menuItemOptions.Text = "&Options";
			// 
			// menuItemSettings
			// 
			this.menuItemSettings.Index = 0;
			this.menuItemSettings.Text = "&Settings...";
			this.menuItemSettings.Click += new System.EventHandler(this.menuItemSettings_Click);
			// 
			// menuItem1
			// 
			this.menuItem1.Index = 1;
			this.menuItem1.Text = "-";
			// 
			// menuItemFileMatches
			// 
			this.menuItemFileMatches.Index = 2;
			this.menuItemFileMatches.Text = "&MIME types...";
			this.menuItemFileMatches.Click += new System.EventHandler(this.menuItemFileMatches_Click);
			// 
			// menuItemOutput
			// 
			this.menuItemOutput.Index = 3;
			this.menuItemOutput.Text = "&Output...";
			this.menuItemOutput.Click += new System.EventHandler(this.menuItemOutput_Click);
			// 
			// menuItemConnections
			// 
			this.menuItemConnections.Index = 4;
			this.menuItemConnections.Text = "&Connections...";
			this.menuItemConnections.Click += new System.EventHandler(this.menuItemConnections_Click);
			// 
			// menuItemAdvanced
			// 
			this.menuItemAdvanced.Index = 5;
			this.menuItemAdvanced.Text = "&Advanced...";
			this.menuItemAdvanced.Click += new System.EventHandler(this.menuItemAdvanced_Click);
			// 
			// menuItemHelp
			// 
			this.menuItemHelp.Index = 2;
			this.menuItemHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																						 this.menuItemAbout});
			this.menuItemHelp.Text = "&Help";
			// 
			// menuItemAbout
			// 
			this.menuItemAbout.Index = 0;
			this.menuItemAbout.Text = "&About...";
			this.menuItemAbout.Click += new System.EventHandler(this.menuItemAbout_Click);
			// 
			// toolBarMain
			// 
			this.toolBarMain.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
			this.toolBarMain.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
																						   this.toolBarButtonContinue,
																						   this.toolBarButtonPause,
																						   this.toolBarButtonStop,
																						   this.toolBarButton1,
																						   this.toolBarButtonDeleteAll,
																						   this.toolBarButton2,
																						   this.toolBarButtonSettings});
			this.toolBarMain.ButtonSize = new System.Drawing.Size(16, 16);
			this.toolBarMain.DropDownArrows = true;
			this.toolBarMain.ImageList = this.imageList2;
			this.toolBarMain.Location = new System.Drawing.Point(0, 0);
			this.toolBarMain.Name = "toolBarMain";
			this.toolBarMain.ShowToolTips = true;
			this.toolBarMain.Size = new System.Drawing.Size(680, 28);
			this.toolBarMain.TabIndex = 0;
			this.toolBarMain.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBarMain_ButtonClick);
			// 
			// toolBarButtonContinue
			// 
			this.toolBarButtonContinue.Enabled = false;
			this.toolBarButtonContinue.ImageIndex = 0;
			this.toolBarButtonContinue.ToolTipText = "Coninue parsing process";
			// 
			// toolBarButtonPause
			// 
			this.toolBarButtonPause.Enabled = false;
			this.toolBarButtonPause.ImageIndex = 1;
			this.toolBarButtonPause.ToolTipText = "Pause parsing process";
			// 
			// toolBarButtonStop
			// 
			this.toolBarButtonStop.ImageIndex = 2;
			this.toolBarButtonStop.ToolTipText = "Stop parsing process";
			// 
			// toolBarButton1
			// 
			this.toolBarButton1.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
			// 
			// toolBarButtonDeleteAll
			// 
			this.toolBarButtonDeleteAll.ImageIndex = 3;
			this.toolBarButtonDeleteAll.ToolTipText = "Delete all results";
			// 
			// toolBarButton2
			// 
			this.toolBarButton2.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
			// 
			// toolBarButtonSettings
			// 
			this.toolBarButtonSettings.DropDownMenu = this.contextMenuSettings;
			this.toolBarButtonSettings.ImageIndex = 4;
			this.toolBarButtonSettings.Style = System.Windows.Forms.ToolBarButtonStyle.DropDownButton;
			this.toolBarButtonSettings.ToolTipText = "Show settings form";
			// 
			// contextMenuSettings
			// 
			this.contextMenuSettings.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																								this.menuItemSettingsFileMatches,
																								this.menuItemSettingsOutput,
																								this.menuItemSettingsConnections,
																								this.menuItemSettingsAdvanced});
			// 
			// menuItemSettingsFileMatches
			// 
			this.menuItemSettingsFileMatches.Index = 0;
			this.menuItemSettingsFileMatches.Text = "&MIME types...";
			this.menuItemSettingsFileMatches.Click += new System.EventHandler(this.menuItemSettingsFileMatches_Click);
			// 
			// menuItemSettingsOutput
			// 
			this.menuItemSettingsOutput.Index = 1;
			this.menuItemSettingsOutput.Text = "&Output...";
			this.menuItemSettingsOutput.Click += new System.EventHandler(this.menuItemSettingsOutput_Click);
			// 
			// menuItemSettingsConnections
			// 
			this.menuItemSettingsConnections.Index = 2;
			this.menuItemSettingsConnections.Text = "&Connections...";
			this.menuItemSettingsConnections.Click += new System.EventHandler(this.menuItemSettingsConnections_Click);
			// 
			// menuItemSettingsAdvanced
			// 
			this.menuItemSettingsAdvanced.Index = 3;
			this.menuItemSettingsAdvanced.Text = "&Advanced...";
			this.menuItemSettingsAdvanced.Click += new System.EventHandler(this.menuItemSettingsAdvanced_Click);
			// 
			// imageList2
			// 
			this.imageList2.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
			this.imageList2.ImageSize = new System.Drawing.Size(16, 16);
			this.imageList2.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList2.ImageStream")));
			this.imageList2.TransparentColor = System.Drawing.Color.Transparent;
			// 
			// statusBar
			// 
			this.statusBar.Location = new System.Drawing.Point(0, 291);
			this.statusBar.Name = "statusBar";
			this.statusBar.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
																						 this.statusBarPanelInfo,
																						 this.statusBarPanelURLs,
																						 this.statusBarPanelFiles,
																						 this.statusBarPanelByteCount,
																						 this.statusBarPanelErrors,
																						 this.statusBarPanelCPU,
																						 this.statusBarPanelMem});
			this.statusBar.ShowPanels = true;
			this.statusBar.Size = new System.Drawing.Size(680, 22);
			this.statusBar.TabIndex = 1;

⌨️ 快捷键说明

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