E3.Utility/UtilityXML.cs
(开头部分) 12KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml;
using System.Net;
using System.Reflection;
using System.Diagnostics;
using System.Collections.Specialized;
namespace E3.Utility
{
public partial class UtilityXML
{
#region 产生日志方法
//产生日志文件
public static void WriteXMLLog(object oj, bool IsLogNomarl, string ExMessage)
{
string LogPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "Log";
//string LogDir = System.IO.Path.GetDirectoryName(LogPath);
if (!Directory.Exists(LogPath))
{
Directory.CreateDirectory(LogPath);
}
string ProductName = System.Windows.Forms.Application.ProductName;
string ErrorFileName = "Error_" + ProductName + "_" + DateTime.Today.ToString("yyyyMMdd") + ".xml";
string NormalFileName = "Log_" + ProductName + "_" + DateTime.Today.ToString("yyyyMMdd") + ".xml";
string LogFilePath = string.Empty;
if (IsLogNomarl)
{
LogFilePath = LogPath + "\\" + NormalFileName;
}
else
{
LogFilePath = LogPath + "\\" + ErrorFileName;
}
if (System.IO.File.Exists(LogFilePath))
{
UpdateLogXMLNode(LogFilePath, ProductName, oj, ExMessage);
}
else
{
CreateLogXML(LogFilePath, ProductName, oj, ExMessage);
}
}
//更新日志文件
private static void UpdateLogXMLNode(string path, string ProductName, object oj, string ExMessage)
{
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(path);
string ProductNote = "UADC_" + ProductName;
AddLogXmlSnNode(xmldoc, ProductNote, oj, ExMessage);
xmldoc.Save(path);
后面还有 254 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。