diff --git a/CleanMachine.Control/CleanMachine.Control.csproj b/CleanMachine.Control/CleanMachine.Control.csproj index 191653e..9eaabdb 100644 --- a/CleanMachine.Control/CleanMachine.Control.csproj +++ b/CleanMachine.Control/CleanMachine.Control.csproj @@ -1,7 +1,7 @@  - net48 + net472 diff --git a/CleanMachine.Model/CleanMachine.Model.csproj b/CleanMachine.Model/CleanMachine.Model.csproj index 2b2cb63..9f5c4f4 100644 --- a/CleanMachine.Model/CleanMachine.Model.csproj +++ b/CleanMachine.Model/CleanMachine.Model.csproj @@ -1,7 +1,7 @@ - net48 + netstandard2.0 diff --git a/CleanMachineHMI.Model/CleanMachineHMI.Domain.csproj b/CleanMachineHMI.Model/CleanMachineHMI.Domain.csproj index cbe12f0..00f1a7c 100644 --- a/CleanMachineHMI.Model/CleanMachineHMI.Domain.csproj +++ b/CleanMachineHMI.Model/CleanMachineHMI.Domain.csproj @@ -1,7 +1,7 @@  - net48 + netstandard1.3 diff --git a/CleanMachineHMI/CleanMachineHMI.csproj b/CleanMachineHMI/CleanMachineHMI.csproj index 776fe95..6b4fa6d 100644 --- a/CleanMachineHMI/CleanMachineHMI.csproj +++ b/CleanMachineHMI/CleanMachineHMI.csproj @@ -2,7 +2,7 @@ WinExe - net48 + net472 true @@ -52,6 +52,12 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + \ No newline at end of file diff --git a/LeadDataBaseUtility/LeadDataBaseUtility.csproj b/LeadDataBaseUtility/LeadDataBaseUtility.csproj index d456863..5b89e90 100644 --- a/LeadDataBaseUtility/LeadDataBaseUtility.csproj +++ b/LeadDataBaseUtility/LeadDataBaseUtility.csproj @@ -1,7 +1,7 @@  - net48 + netstandard2.0 diff --git a/LeadDataBaseUtility/LeadDbHelperSQLite.cs b/LeadDataBaseUtility/LeadDbHelperSQLite.cs index 96f2cf3..d9f86fa 100644 --- a/LeadDataBaseUtility/LeadDbHelperSQLite.cs +++ b/LeadDataBaseUtility/LeadDbHelperSQLite.cs @@ -18,7 +18,7 @@ namespace LeadDataBaseUtility /// public abstract class LeadDbHelperSQLite { - public static string connectionString = LeadConfigureConnectionString.getConnectionString("LeadSQLite"); + public static string connectionString = LeadConfigureConnectionString.getConnectionString("LeadSQLite"); /// /// 对SQLite数据库执行增删改操作,返回受影响的行数。 @@ -99,7 +99,7 @@ namespace LeadDataBaseUtility return obj; } } - catch (System.Data.SqlClient.SqlException e) + catch (System.Data.SQLite.SQLiteException e) { connection.Close(); LogHelper.WriteLog($"数据库运行异常:【{e.Message}】。SQL语句:【{SQLString}】。", LogTypeEum.DbErr); diff --git a/NX_LogUtility/LogHelper.cs b/NX_LogUtility/LogHelper.cs index df1abf8..a26f3bb 100644 --- a/NX_LogUtility/LogHelper.cs +++ b/NX_LogUtility/LogHelper.cs @@ -44,21 +44,21 @@ namespace NX_LogUtility /// 日志类型(Run:程序运行日志; Err:程序错误日志; DbErr:数据库异常相关日志; OPCRun:OPC运行日志; SocketRun:Socket运行日志; SocErr:Socket异常日志。) public static void WriteLog(string Txt, LogTypeEum logType) { - ////获取日志存放位置,年份不同,存放文件夹不同。 - //string strDir = System.Environment.CurrentDirectory + "\\NX_CleanMac_Log\\" + DateTime.Now.ToString("yyyy") + "\\"; - ////获取时间,年月日。 - //string fileDate = DateTime.Now.ToString("yyyy-MM-dd"); - ////获取时间,年月。 - //string fileDate1 = DateTime.Now.ToString("yyyy-MM"); - ////每一年的不同月份日志放在不同的文件夹,同一月份不同类型的日志放于同一个文件夹。 - //string strDir1 = strDir + fileDate1 + "\\"; - ////每一年的相同月份不同日期的日志放在不同的文件夹 - //string strDir2 = strDir1 + fileDate + "\\"; - ////不同的日志名称,日志文件不同 - //string filePath = strDir2 + fileDate + "_" + logType + ".log"; - //string DateString = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); - //string Str = "发生时间:" + DateString + "|" + Txt + "\r\n"; - //WriteFile(strDir2, filePath, Str); + //获取日志存放位置,年份不同,存放文件夹不同。 + string strDir = System.Environment.CurrentDirectory + "\\NX_CleanMac_Log\\" + DateTime.Now.ToString("yyyy") + "\\"; + //获取时间,年月日。 + string fileDate = DateTime.Now.ToString("yyyy-MM-dd"); + //获取时间,年月。 + string fileDate1 = DateTime.Now.ToString("yyyy-MM"); + //每一年的不同月份日志放在不同的文件夹,同一月份不同类型的日志放于同一个文件夹。 + string strDir1 = strDir + fileDate1 + "\\"; + //每一年的相同月份不同日期的日志放在不同的文件夹 + string strDir2 = strDir1 + fileDate + "\\"; + //不同的日志名称,日志文件不同 + string filePath = strDir2 + fileDate + "_" + logType + ".log"; + string DateString = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); + string Str = "发生时间:" + DateString + "|" + Txt + "\r\n"; + WriteFile(strDir2, filePath, Str); } private static readonly object lockobj = new object(); diff --git a/NX_LogUtility/NX_LogUtility.csproj b/NX_LogUtility/NX_LogUtility.csproj index cbe12f0..62e8ee6 100644 --- a/NX_LogUtility/NX_LogUtility.csproj +++ b/NX_LogUtility/NX_LogUtility.csproj @@ -1,7 +1,7 @@  - net48 + netstandard2.0