Conris.Utility/NetLog.cs
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace Conris.Utility
{
public class NetLog
{
public NetLog()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
//添加文本
public void WriterLog(string path, string logName, string log)
{
string page = "";
WriterLog(path, logName, log, page);
}
public void WriterLog(string path, string logName, string log, string page)
{
System.DateTime tm = DateTime.Now;
string p = path + logName;
if (!Directory.Exists(path))//判断路径下目录是否存在
{
Directory.CreateDirectory(path);
if (!File.Exists(p))
{
using (StreamWriter sw = File.CreateText(p))
{
sw.WriteLine(log + "----------" + tm + "[" + page + "]");
}
}
else
{
using (StreamWriter sw = File.AppendText(p))
{
sw.WriteLine(log + "----------" + tm + "[" + page + "]");
}
}
}
else
{
if (!File.Exists(p))
{
using (StreamWriter sw = File.CreateText(p))
{
sw.WriteLine(log + "----------" + tm + "[" + page + "]");
}
}
else
{
using (StreamWriter sw = File.AppendText(p))
{
sw.WriteLine(log + "----------" + tm + "[" + page + "]");
后面还有 7 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
