This commit is contained in:
sc committed 2024-10-29 00:03:43 +08:00
commit 007e5cb414
21 files changed
+5857 -68

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
using System.Management;
namespace DyeingComputer.UserClass
namespace SunlightCentralizedControlManagement_SCCM_.UserClass
{
/// <summary>
/// 获取硬件SN
+1 -24
View File
@@ -1,18 +1,14 @@
using DyeingComputer.ViewModel;
using SunlightCentralizedControlManagement_SCCM_.ViewModel;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using static DyeingComputer.UserClass.SqliteHelper;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
namespace DyeingComputer.UserClass
{
public class LogGing
{
private static SQLiteHelper SQLiteHelpers = null; //定义数据库
private readonly static string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
public static bool sqld=false;
public static void LogGingDATA(string dat)
{
string logpath = System.Environment.CurrentDirectory + "\\Log";//日志文件目录
@@ -47,24 +43,5 @@ namespace DyeingComputer.UserClass
directoryInfo.Create();//创建日志路径
}
}
public static void LogSQLDATA(string NAME, string api, string dat)
{
if (!sqld)
{
sqld = true;
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
string Log_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
Dictionary<string, object> logsql = new Dictionary<string, object>();
// 添加元素
logsql.Add("NAME", NAME);
logsql.Add("API", api);
logsql.Add("MESSAGE", dat);
logsql.Add("TIME", Log_time);
SQLiteHelpers.Open(); //打开数据库
SQLiteHelpers.InsertData("SERVER", logsql);//行插入
SQLiteHelpers.Close(); //关闭连接
sqld = false;
}
}
}
}