Esempio n. 1
0
        private void button7_Click(object sender, EventArgs e)  //测试文件提取特征
        {
            //遍历文档
            string        dirWord    = textBox3.Text;
            DirectoryInfo folderWord = new DirectoryInfo(dirWord);
            ArrayList     pathWord   = new ArrayList();

            foreach (FileInfo wordfile in folderWord.GetFiles())
            {
                if (wordfile.Name.Substring(0, 2) != "~$")
                {
                    string pathWord_temp            = dirWord + "\\" + wordfile.Name;
                    string pathWordWithoutExtension = System.IO.Path.GetFileNameWithoutExtension(pathWord_temp); //无后缀的xml文件名
                    pathWord.Add(pathWord_temp);                                                                 //word文档地址
                }
            }
            testFillXML fillxml = new testFillXML();

            richTextBoxTest.SelectionStart  = richTextBoxTest.Text.Length;
            richTextBoxTest.SelectionLength = 0;
            richTextBoxTest.Focus();
            string stateOfFillXML = fillxml.Fill(pathWord, richTextBoxTest);

            MessageBox.Show(stateOfFillXML);
        }
Esempio n. 2
0
        private void button8_Click(object sender, EventArgs e) //添加段落角色
        {
            //遍历文档
            string        dirWord    = textBox3.Text;
            DirectoryInfo folderWord = new DirectoryInfo(dirWord);
            ArrayList     pathWord   = new ArrayList();

            foreach (FileInfo wordfile in folderWord.GetFiles())
            {
                if (wordfile.Name.Substring(0, 2) != "~$")
                {
                    string pathWord_temp            = dirWord + "\\" + wordfile.Name;
                    string pathWordWithoutExtension = System.IO.Path.GetFileNameWithoutExtension(pathWord_temp); //无后缀的xml文件名
                    pathWord.Add(pathWord_temp);                                                                 //word文档地址
                }
            }

            testFillXML fillxml = new testFillXML();

            fillxml.FillParaId(pathWord);
            //在状态栏显示自动填充属性完成状态
        }