XMLHelper.cs 691 B

1234567891011121314151617181920212223242526
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Xml;
  8. namespace Pms.UserEvent.Model
  9. {
  10. public class XMLHelper
  11. {
  12. public static void CreateOrLoadXml(string strPath, string strNode)
  13. {
  14. if (string.IsNullOrWhiteSpace(strPath)) return;
  15. if (!File.Exists(strPath))
  16. {
  17. File.AppendAllText(strPath, "<?xml version=\"1.0\"?>");
  18. File.AppendAllText(strPath, string.Format("<{0}></{0}>", strNode));
  19. }
  20. //XmlDocument xml = new XmlDocument();
  21. //xml.Load(strPath);
  22. }
  23. }
  24. }