コード例 #1
0
ファイル: Form1.cs プロジェクト: usmanghani/Misc
        private void button2_Click(object sender, EventArgs e)
        {
            string path = Application.StartupPath + "\\empty.html";
            if (!System.IO.File.Exists(path))
            {
                System.IO.File.Create(path);

            }

            webBrowser1.Url = new Uri("file:///" + path);
            listBox1.Items.Clear();
            label1.Text = "Searching...";

            if (isearcher == null) isearcher = new Searcher(_indexTarget);

            results = isearcher.FastSearch(textBox2.Text);

            label1.Text = results.Length.ToString() + " hit(s).";

            foreach (SearchResult result in results)
            {
                listBox1.Items.Add(result.GetDocTitle());

            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: usmanghani/Misc
        private void button1_Click(object sender, EventArgs e)
        {
            if (isearcher != null) isearcher.Close();
            isearcher = null;

            folderBrowserDialog1.ShowNewFolderButton = false;
            if (folderBrowserDialog1.ShowDialog() != DialogResult.OK || folderBrowserDialog1.SelectedPath == string.Empty)
            {
                return;

            }
            textBox1.Text = folderBrowserDialog1.SelectedPath;
            Indexer indexer = new Indexer(_indexTarget);
            indexer.UpdateCallback = new IndexerUpdateCallback(this.UpdateIndexingInfo);
            indexer.IndexDirectory(folderBrowserDialog1.SelectedPath);
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: usmanghani/Misc
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == string.Empty) return;

            Searcher searcher = new Searcher("c:\\kanzuliman");

            results = searcher.FastSearch(textBox1.Text);

            listBox1.Items.Clear();

            label1.Text = results.Length.ToString() + " hit(s).";

            foreach (SearchResult result in results)
            {
                string para = result.GetDocProperty("pid");
                string sura = result.GetDocProperty("sid");
                string ayah = result.GetDocProperty("ayatno");

                string temp = "Para: " + para + ", Sura: " + sura + ", Ayah: " + ayah;

                listBox1.Items.Add(temp);

            }
        }
コード例 #4
0
ファイル: Form1.cs プロジェクト: usmanghani/Misc
 private void button4_Click(object sender, EventArgs e)
 {
     listBox1.Items.Clear();
     Searcher isearcher = new Searcher(_indexTarget);
     string [] docs = isearcher.SearchDocs(textBox2.Text);
     label1.Text = docs.Length.ToString() + " hit(s).";
     listBox1.Items.AddRange(docs);
     isearcher.Close();
 }