public void SearchMultipleTags() { if (txtSearchTag.Text != "") { try { //string str = null; //XmlNodeList nodelist; string folderPath = textBox2.Text; DirectoryInfo di = new DirectoryInfo(folderPath); FileInfo[] rgFiles = di.GetFiles("*.xml"); foreach (FileInfo fi in rgFiles) { int i = 0; XmlDocument xmldoc = new XmlDocument(); xmldoc.Load(fi.FullName); //rtbox2.Text = fi.FullName.ToString(); foreach (XmlNode node in xmldoc.GetElementsByTagName(txtSearchTag.Text)) { i = i + 1; // } rtbox2.Text += DateTime.Now + "\n" + fi.FullName + " \nInstance: " + i.ToString() + "\n\n"; //rtbox2.Text += fi.FullName + "instances: " + str.ToString(); } } catch (Exception) { MessageBox.Show("Invalid Path or Empty File name field."); } } else { MessageBox.Show("Dont leave field blanks."); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)