Example #1
0
        /// <summary>
        /// 创建根节点对象
        /// </summary>
        /// <param name="xmlFilePath">Xml文件的相对路径</param>
        private static XmlElement CreateRootElement(string xmlFilePath)
        {
            //定义变量,表示XML文件的绝对路径
            string filePath = "";

            //获取XML文件的绝对路径
            filePath = APPHelper.GetPath(xmlFilePath);

            //创建XmlDocument对象
            XmlDocument xmlDocument = new XmlDocument();

            //加载XML文件
            xmlDocument.Load(filePath);

            //返回根节点
            return(xmlDocument.DocumentElement);
        }
Example #2
0
 /// <summary>
 /// 实例化XmlHelper对象
 /// </summary>
 /// <param name="xmlFilePath">Xml文件的相对路径</param>
 public XmlHelper(string xmlFilePath)
 {
     //获取XML文件的绝对路径
     _filePath = APPHelper.GetPath(xmlFilePath);
 }
Example #3
0
 /// <summary>
 /// 实例化XmlOperate对象
 /// </summary>
 /// <param name="xmlFilePath">Xml文件的相对路径</param>
 public XmlOperate(string xmlFilePath)
 {
     //获取XML文件的绝对路径
     this._XMLPath = _filePath = APPHelper.GetPath(xmlFilePath);
 }