Пример #1
0
 private void FrmEditInfoBox_Load(object sender, EventArgs e)
 {
     try
     {
         string filepath = EditTemplateInfo.GetEditXmlPathName((EditPath.Substring(0, EditPath.IndexOf(".")) + ".xml"));
         Lb_editname.Text       = EditTemplateInfo.GetEditXmlDocument((EditPath.Substring(0, EditPath.IndexOf(".")) + ".xml")).DocumentElement.ChildNodes[2].InnerText;
         Lb_createtime.Text     = File.GetCreationTime(filepath).ToString();
         Lb_lastwritetime.Text  = File.GetLastAccessTime(filepath).ToString();
         Lb_lastaccesstime.Text = File.GetLastWriteTime(filepath).ToString();
     }
     catch { }
 }
Пример #2
0
 /// <summary>
 /// 保存模板属性
 /// </summary>
 private void SaveEditProperty()
 {
     try
     {
         XmlDocument    document = new XmlDocument();
         XmlDeclaration decl     = document.CreateXmlDeclaration("1.0", "UTF-8", null); //XML申明
         document.AppendChild(decl);
         XmlElement Custom_Root = document.CreateElement("Custom_Root");                //根节点
         //保存全局节点信息
         SaveGlobalXmlNode(document, Custom_Root);
         //保存项节点信息
         SaveItemXmlNode(document, Custom_Root);
         document.AppendChild(Custom_Root);
         document.Save(EditTemplateInfo.GetEditXmlPathName(EditName.Substring(0, EditName.IndexOf(".")) + ".xml"));
     }
     catch (Exception err) { }
 }