コード例 #1
0
ファイル: MainApp_Muma.cs プロジェクト: radtek/SiteWatcher
        private void tlbtnFindMuma_Click(object sender, EventArgs e)
        {
            lstbFileList.Items.Clear();
            dlgShowScanInfo       = ShowScanInfo;
            dlgAddScanFileToList  = AddScanFileToList;
            dlgIsEnableBtn        = IsEnableBtn;
            dlgListViewItemUpdate = ListViewItemUpdate;

            string sScanFileType = tooltxtScanFileType.Text.Trim();

            if (!string.IsNullOrEmpty(sScanFileType))
            {
                aScanFileType = sScanFileType.Split(',');
            }
            else
            {
                MessageBox.Show("请设置扫描的文件类型!如 .aspx,.html");
            }

            string sNoscanfoldr = Core.Configs.ConfigsControl.Instance.NoScanFolder;

            if (!string.IsNullOrEmpty(sNoscanfoldr))
            {
                aNoScanFolder = sNoscanfoldr.Split(',');
            }


            if (thMumaFind == null)
            {
                thMumaFind = new Thread(new ThreadStart(startsearch));
            }

            if (thMumaFind.ThreadState == ThreadState.Stopped)
            {
                thMumaFind = null;
                thMumaFind = new Thread(new ThreadStart(startsearch));
            }

            if (!thMumaFind.IsAlive)
            {
                thMumaFind.Start();

                btnPause.Enabled = true;
                btnStop.Enabled  = true;
            }
        }
コード例 #2
0
ファイル: FileSearch.cs プロジェクト: radtek/SiteWatcher
        public void ToSearch(string keyword, string replace)
        {
            FindKey    = keyword;
            ReplaceKey = replace;
            string sScanFileType = txtFileType.Text.Trim();

            if (!string.IsNullOrEmpty(sScanFileType))
            {
                aScanFileType = sScanFileType.Split(',');
            }
            else
            {
                MessageBox.Show("请设置扫描的文件类型!如 .aspx,.html");
            }

            lstFiles.Items.Clear();
            dlgShowScanInfo       = ShowScanInfo;
            dlgAddScanFileToList  = AddScanFileToList;
            dlgIsEnableBtn        = IsEnableBtn;
            dlgListViewItemUpdate = ListViewItemUpdate;


            if (search_thread == null)
            {
                search_thread = new Thread(new ThreadStart(startsearch));
            }

            if (search_thread.ThreadState == ThreadState.Stopped)
            {
                search_thread = null;
                search_thread = new Thread(new ThreadStart(startsearch));
            }

            if (!search_thread.IsAlive)
            {
                search_thread.Start();

                btnPause.Enabled = true;
                btnStop.Enabled  = true;
            }
        }