黄学彪
2019-10-29 0f5a53c7b36c27a0f2bec12e6119207edb6860f8
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlLogLogic.cs
@@ -66,14 +66,21 @@
                //    return;
                //}
                //Log文件
                string fileName = this.GetLogFile(div);
                string fullName = UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.LogDirectory, fileName);
                strLog = "[" + DateTime.Now.ToString("yyyyMMdd HH:mm:ss") + "] " + strLog + "\r\n";
                var sw = new System.IO.StreamWriter(fullName, true, Encoding.UTF8);
                sw.WriteLine(strLog);
                sw.Close();
                sw = null;
                System.IO.StreamWriter sw = null;
                try
                {
                    string fileName = this.GetLogFile(div);
                    string fullName = UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.LogDirectory, fileName);
                    strLog = "[" + DateTime.Now.ToString("yyyyMMdd HH:mm:ss") + "] " + strLog + "\r\n";
                    sw = new System.IO.StreamWriter(fullName, true, Encoding.UTF8);
                    sw.WriteLine(strLog);
                }
                catch { }
                finally
                {
                    sw?.Close();
                    sw = null;
                }
            }
        }