windows服务,配置程序随系统启动
高胜
2023-03-23 ae55a952b05bfe9f5dd81ca6738fe329e20f6a7a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace RestartService.Alarm
{
    public class LogHp
    {
        public static void WriteLog(string name, string content)
        {
            File.AppendAllText(AppDomain.CurrentDomain.BaseDirectory + $"Logs//{name} {DateTime.Now.ToString("yyyy-MM-dd")}.txt", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "\r\n" + content + "\r\n\r\n===============================================\r\n\r\n");
 
        }
    }
}