📄 frmmain.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Threading;
using Lucene.Net.Index;
using Lucene.Net.Analysis.Standard;
using ShootSearch.Spiders;
using ShootSearch.Spiders.http;
using ShootSearch.Helper;
using ShootSearch.Indexing;
using ShootSearch.Logging;
namespace ShootSearch
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class frmMain : System.Windows.Forms.Form ,ShootSearch.Logging.ConsoleOut
{
private System.Windows.Forms.Button button4;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.LinkLabel linkLabel2;
private System.Windows.Forms.LinkLabel linkLabel3;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnStart;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
private System.Windows.Forms.StatusBar statusBar;
private System.Windows.Forms.StatusBarPanel statusPanelTotal;
private System.Windows.Forms.StatusBarPanel statusPanelTime;
private System.Windows.Forms.Button button_Options;
private System.Windows.Forms.Button button_JobList;
private System.Windows.Forms.RichTextBox richTextBox_Console;
private System.Windows.Forms.Button button_ConsoleSave;
private System.Windows.Forms.Button button_ConsoleClear;
private System.Windows.Forms.SaveFileDialog saveFileDialog_Console;
private System.Windows.Forms.StatusBarPanel statusPanelIndex;
private System.Windows.Forms.Label label2;
SpiderMan m_spider;
public frmMain()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.button_JobList = new System.Windows.Forms.Button();
this.btnStart = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label2 = new System.Windows.Forms.Label();
this.button_ConsoleSave = new System.Windows.Forms.Button();
this.button_ConsoleClear = new System.Windows.Forms.Button();
this.richTextBox_Console = new System.Windows.Forms.RichTextBox();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.linkLabel2 = new System.Windows.Forms.LinkLabel();
this.linkLabel3 = new System.Windows.Forms.LinkLabel();
this.label1 = new System.Windows.Forms.Label();
this.button_Options = new System.Windows.Forms.Button();
this.statusBar = new System.Windows.Forms.StatusBar();
this.statusPanelTotal = new System.Windows.Forms.StatusBarPanel();
this.statusPanelTime = new System.Windows.Forms.StatusBarPanel();
this.statusPanelIndex = new System.Windows.Forms.StatusBarPanel();
this.saveFileDialog_Console = new System.Windows.Forms.SaveFileDialog();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.statusPanelTotal)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusPanelTime)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusPanelIndex)).BeginInit();
this.SuspendLayout();
//
// button_JobList
//
this.button_JobList.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.button_JobList.Location = new System.Drawing.Point(440, 24);
this.button_JobList.Name = "button_JobList";
this.button_JobList.Size = new System.Drawing.Size(128, 40);
this.button_JobList.TabIndex = 1;
this.button_JobList.Text = "设置搜索范围";
this.button_JobList.Click += new System.EventHandler(this.button_JobList_Click);
//
// btnStart
//
this.btnStart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnStart.Location = new System.Drawing.Point(440, 160);
this.btnStart.Name = "btnStart";
this.btnStart.Size = new System.Drawing.Size(128, 40);
this.btnStart.TabIndex = 2;
this.btnStart.Text = "开始制作索引";
this.btnStart.Click += new System.EventHandler(this.btnStart_Click);
//
// button4
//
this.button4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.button4.Location = new System.Drawing.Point(440, 208);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(128, 40);
this.button4.TabIndex = 4;
this.button4.Text = "帮 助";
//
// groupBox1
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.button_ConsoleSave);
this.groupBox1.Controls.Add(this.button_ConsoleClear);
this.groupBox1.Controls.Add(this.richTextBox_Console);
this.groupBox1.Location = new System.Drawing.Point(8, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(424, 392);
this.groupBox1.TabIndex = 5;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "状态:";
//
// label2
//
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label2.ForeColor = System.Drawing.Color.Red;
this.label2.Location = new System.Drawing.Point(24, 368);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(144, 16);
this.label2.TabIndex = 3;
this.label2.Text = "索引会在空闲30秒内完成";
//
// button_ConsoleSave
//
this.button_ConsoleSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button_ConsoleSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button_ConsoleSave.ForeColor = System.Drawing.SystemColors.WindowText;
this.button_ConsoleSave.Location = new System.Drawing.Point(296, 362);
this.button_ConsoleSave.Name = "button_ConsoleSave";
this.button_ConsoleSave.Size = new System.Drawing.Size(48, 24);
this.button_ConsoleSave.TabIndex = 2;
this.button_ConsoleSave.Text = "保存";
//
// button_ConsoleClear
//
this.button_ConsoleClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button_ConsoleClear.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button_ConsoleClear.ForeColor = System.Drawing.SystemColors.WindowText;
this.button_ConsoleClear.Location = new System.Drawing.Point(352, 362);
this.button_ConsoleClear.Name = "button_ConsoleClear";
this.button_ConsoleClear.Size = new System.Drawing.Size(48, 24);
this.button_ConsoleClear.TabIndex = 1;
this.button_ConsoleClear.Text = "清空";
this.button_ConsoleClear.Click += new System.EventHandler(this.button_ConsoleClear_Click);
//
// richTextBox_Console
//
this.richTextBox_Console.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.richTextBox_Console.Location = new System.Drawing.Point(16, 24);
this.richTextBox_Console.Name = "richTextBox_Console";
this.richTextBox_Console.ReadOnly = true;
this.richTextBox_Console.Size = new System.Drawing.Size(392, 336);
this.richTextBox_Console.TabIndex = 0;
this.richTextBox_Console.Text = "";
//
// linkLabel1
//
this.linkLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.linkLabel1.AutoSize = true;
this.linkLabel1.Location = new System.Drawing.Point(464, 312);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(103, 17);
this.linkLabel1.TabIndex = 6;
this.linkLabel1.TabStop = true;
this.linkLabel1.Tag = "http://www.shootsoft.net";
this.linkLabel1.Text = "Shoot Sun Studio";
//
// linkLabel2
//
this.linkLabel2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.linkLabel2.AutoSize = true;
this.linkLabel2.Location = new System.Drawing.Point(456, 336);
this.linkLabel2.Name = "linkLabel2";
this.linkLabel2.Size = new System.Drawing.Size(110, 17);
this.linkLabel2.TabIndex = 7;
this.linkLabel2.TabStop = true;
this.linkLabel2.Tag = "http://www.shootsoft.net";
this.linkLabel2.Text = "www.shootsoft.net";
//
// linkLabel3
//
this.linkLabel3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.linkLabel3.AutoSize = true;
this.linkLabel3.Location = new System.Drawing.Point(440, 360);
this.linkLabel3.Name = "linkLabel3";
this.linkLabel3.Size = new System.Drawing.Size(134, 17);
this.linkLabel3.TabIndex = 8;
this.linkLabel3.TabStop = true;
this.linkLabel3.Tag = "support@shootsoft.net";
this.linkLabel3.Text = "support@shootsoft.net";
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(496, 288);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(60, 17);
this.label1.TabIndex = 9;
this.label1.Text = "CopyRight";
//
// button_Options
//
this.button_Options.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.button_Options.Location = new System.Drawing.Point(440, 72);
this.button_Options.Name = "button_Options";
this.button_Options.Size = new System.Drawing.Size(128, 40);
this.button_Options.TabIndex = 10;
this.button_Options.Text = "其他设置选项";
this.button_Options.Click += new System.EventHandler(this.button_Options_Click);
//
// statusBar
//
this.statusBar.Location = new System.Drawing.Point(0, 421);
this.statusBar.Name = "statusBar";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -