2025-03-14 19:50:18 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Pilot.Report.Exploitation.Common
|
|
|
|
|
{
|
|
|
|
|
public static class Loghelp
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void Log(string str)
|
|
|
|
|
{
|
2025-03-20 09:41:04 +08:00
|
|
|
|
return;
|
2025-03-14 19:50:18 +08:00
|
|
|
|
str = DateTime.Now + "----\n" + str;
|
|
|
|
|
string now = DateTime.Now.Date.ToString("yyyy-MM-dd");
|
|
|
|
|
string currentDirectory = Environment.CurrentDirectory;
|
|
|
|
|
string path = @"D:/RequestLog/";
|
|
|
|
|
string fileName = now + "Log.txt";
|
|
|
|
|
string sourceFilePath = path + fileName;
|
|
|
|
|
if (!Directory.Exists(path))
|
|
|
|
|
{
|
|
|
|
|
Directory.CreateDirectory(path);
|
|
|
|
|
}
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
using (StreamWriter sw = File.AppendText(sourceFilePath))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (!System.IO.File.Exists(sourceFilePath))
|
|
|
|
|
{
|
|
|
|
|
FileInfo fileinfo = new FileInfo(sourceFilePath);
|
|
|
|
|
fileinfo.Create();
|
|
|
|
|
}
|
|
|
|
|
sw.WriteLine(str);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{ }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|