private void SaveXML()
{
FileInfo fileInfo = new FileInfo(AppDomain.CurrentDomain.BaseDirectory + "list.xml");
if (fileInfo.Exists)
{
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(AppDomain.CurrentDomain.BaseDirectory + "list.xml");
XmlNode xmlNode = xmlDocument.SelectSingleNode("Lists");
XmlNodeList xmlNodeList = xmlNode.SelectNodes("List");
foreach (XmlNode node in xmlNodeList)
{
XmlElement element = (XmlElement)node;
element["Time"].InnerText = "12341";
}
xmlDocument.Save(AppDomain.CurrentDomain.BaseDirectory + "list.xml");
}
}
private void GetXML()
{
FileInfo fileInfo = new FileInfo(AppDomain.CurrentDomain.BaseDirectory + "list.xml");
if (fileInfo.Exists)
{
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(AppDomain.CurrentDomain.BaseDirectory + "list.xml");
XmlNode xmlNode = xmlDocument.SelectSingleNode("Lists");
XmlNodeList nodes = xmlNode.SelectNodes("List");
foreach (XmlNode node in nodes)
{
XmlElement element = (XmlElement)node;
string str = element["Time"].InnerText;
MessageBox.Show(str);
}
}
}