Windows服务,线上的监控程序,监控指定的服务
1
高胜
2023-05-23 cf31c5a262ad9f8fe66e884c4ca82d6c060422ff
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 HDLMonitorService.Helper
{
    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");
 
        }
    }
}