From f14dcfd967404e197e7ec995ca8d6f2b090d3b7d Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期五, 11 九月 2020 09:16:59 +0800 Subject: [PATCH] 优化多功能面板:绑定温湿度传感器目标,和设备列表回路显示。优化数据矫正功能温湿度度不设置的情况。优化门锁时间设置最后一天和最后最后一个月的时间显示等 细节 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlLogLogic.cs | 47 ++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 42 insertions(+), 5 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlLogLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlLogLogic.cs index 3c3e6b6..4aa704a 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlLogLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlLogLogic.cs @@ -40,6 +40,39 @@ #region 鈻� Log鍑哄姏____________________________ /// <summary> + /// 璋冭瘯鐢�,杩藉姞鍐欏叆鍏朵粬Log + /// </summary> + /// <param name="fullName">鍏ㄨ矾寰�</param> + /// <param name="i_text">瑕佸啓鍏ョ殑鍐呭</param> + /// <param name="deleteFile">鏄惁鍏堝垹闄ゆ枃浠�</param> + /// <param name="encrypt">鍐欏叆鐨勫唴瀹规槸鍚﹀姞瀵�</param> + public void WriteOtherText(string fullName, string i_text, bool deleteFile, bool encrypt) + { + if (deleteFile == true) + { + HdlFileLogic.Current.DeleteFile(fullName); + } + System.IO.StreamWriter sw = null; + try + { + string strLog = "[" + DateTime.Now.ToString("yyyyMMdd HH:mm:ss") + "] " + i_text; + if (encrypt == true) + { + strLog = UserCenterLogic.EncryptPassword(UserCenterResourse.FileEncryptKey, strLog); + } + strLog = "\r\n" + strLog + "\r\n"; + sw = new System.IO.StreamWriter(fullName, true, Encoding.UTF8); + sw.WriteLine(strLog); + } + catch { } + finally + { + sw?.Close(); + sw = null; + } + } + + /// <summary> /// Log鍑哄姏 /// </summary> /// <param name="ex"></param> @@ -56,13 +89,13 @@ /// <summary> /// Log鍑哄姏 /// </summary> - /// <param name="div">1:鏅�歀og,-1:鑷村懡閿欒Log,2:鐗规畩Log</param> + /// <param name="div">1:鏅�歀og,-1:鑷村懡閿欒Log,2,3:鐗规畩Log</param> /// <param name="strLog">Log鍐呭</param> public void WriteLog(int div, string strLog) { lock (objLock) { - if (div != -1 && div != 2 && UserCenterResourse.HideOption.DetailedLog == 0) + if (div == 1 && UserCenterResourse.HideOption.DetailedLog == 0) { //鏆傛椂鍙褰曞紓甯镐俊鎭� return; @@ -72,15 +105,19 @@ try { string fullName = string.Empty; - if (div != 2) + if (div == 1 || div == -1) { string fileName = this.GetLogFile(div); - fullName = UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.LogDirectory, fileName); + fullName = System.IO.Path.Combine(DirNameResourse.LogDirectory, fileName); } - else + else if (div == 2) { fullName = DirNameResourse.SendAndReceveDataLog; } + else if (div == 3) + { + fullName = DirNameResourse.SocketReceiveDataLog; + } strLog = "\r\n[" + DateTime.Now.ToString("yyyyMMdd HH:mm:ss") + "] " + strLog + "\r\n"; sw = new System.IO.StreamWriter(fullName, true, Encoding.UTF8); sw.WriteLine(strLog); -- Gitblit v1.8.0