public void ReadConfigXML()
{
XmlDocument doc = new XmlDocument();
doc.Load(Directory.GetCurrentDirectory().
ToString() +
@"\config.xml");
XmlNodeList nodes = doc.SelectNodes(
"/xml/ext/@* | /xml/ext/text()");
foreach (XmlNode node in nodes)
{
comboBox1.Items.Add(node.Value);
}
nodes = doc.SelectNodes(
"/xml/title/@* | /xml/title/text()");
foreach (XmlNode node in nodes)
{
appTitle = node.Value;
}
nodes = doc.SelectNodes(
"/xml/daysold/@* | /xml/daysold/text()");
foreach (XmlNode node in nodes)
{
txtDaysOld.Value =
Convert.ToInt32(node.Value.ToString());
}
nodes = doc.SelectNodes(
"/xml/path/@* | /xml/path/text()");
foreach (XmlNode node in nodes)
{
txtFileName.Text = node.Value;
}
nodes = doc.SelectNodes(
"/xml/logfile/@* | /xml/logfile/text()");
foreach (XmlNode node in nodes)
{
LogFile = Directory.GetCurrentDirectory().
ToString() + @"\" + node.Value;
}
}
No comments:
Post a Comment