You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
921 B
34 lines
921 B
3 years ago
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Text;
|
||
|
using System.IO;
|
||
|
using Stone.Common.Biz;
|
||
|
|
||
|
namespace Stone.Common
|
||
|
{
|
||
|
public class MyLogger
|
||
|
{
|
||
|
public static string path = "";
|
||
|
public static void Write(string content)
|
||
|
{
|
||
|
try
|
||
|
{
|
||
|
path = DllPath.GetDllPath() + "//Logs";
|
||
|
if (!Directory.Exists(path))
|
||
|
{
|
||
|
Directory.CreateDirectory(path);
|
||
|
}
|
||
|
|
||
|
string filename = path + "//" + DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + ".txt";
|
||
|
StreamWriter sw = new StreamWriter(filename, true, Encoding.Unicode);
|
||
|
sw.WriteLine(DateTime.Now.ToString());
|
||
|
sw.WriteLine(content);
|
||
|
sw.Close();
|
||
|
}
|
||
|
catch
|
||
|
{
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|