You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static Txgy.EWS.Client.Common.Helpers.LogParameter;
using System.Web.UI.WebControls;
using System.Xml;
using System.IO;
namespace Txgy.EWS.Client.Common.Helpers
{
public static class XMLHelper
{
public static void ReadXml()
{
try
{
XmlDocument doc = new XmlDocument();
doc.Load(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "XML", "Config.xml"));
var node = doc.SelectSingleNode("appSettings");
LogParameter.LogLevel = (LogLevelEnum)Enum.Parse(typeof(LogLevelEnum), node.SelectSingleNode("LogLevel").InnerText);
LogParameter.LogFilePath = node.SelectSingleNode("LogFilePath").InnerText;
LogParameter.LogFileExistDay = int.Parse(node.SelectSingleNode("LogFileExistDay").InnerText);
//CommonLogHelper.Debug("XML文件读取成功。");
}
catch (Exception ex)
{
//CommonLogHelper.log.Error(string.Format("XML文件读取失败。{0}", ex));
}
}
}
}