Beispiel #1
0
        /// <summary>
        /// 导入搜索关键字表
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void loadKeys_Click(object sender, EventArgs e)
        {
            bool res = false;

            timerAct.acts.Clear();
            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                List <string> list = Util.readListTxt(openFileDialog.FileName);

                foreach (string key in list)
                {
                    if (key.Trim() == "")
                    {
                        continue;
                    }
                    TimerAct t = TimerAct.getDefaultTimerAct(key, timerAct.acts.Count);
                    timerAct.acts.AddRange(t.acts);
                }
                initListBox(timerAct);
                seqBtn_Click(sender, e);
                res = true;
            }
            this.Refresh();
            if (res)
            {
                statusLab.Text = "导入关键字库成功:" + openFileDialog.FileName;
            }
            else
            {
                statusLab.Text = "取消导入关键字库:" + openFileDialog.FileName;
            }
        }