From 00ab3ddb140ba8bb88b5cf572b004a85e1da85e9 Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期四, 02 一月 2020 19:51:56 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev-tzy' into DEV_GXC --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs | 27 +++++++++++++++++++-------- 1 files changed, 19 insertions(+), 8 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs index cafdac5..d986516 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs @@ -420,12 +420,9 @@ nvc.Add("ManualBackupType", ManualBackupType.ToString()); nvc.Add("IsOtherAccountCtrl", Common.Config.Instance.isAdministrator.ToString()); - for (int i = 0; i < listPicFile.Count; i++) - { - string base64 = GetBase64Text(fullName); - nvc.Add("UploadSubFileLists[" + i + "].BackupFileName", fileName); - nvc.Add("UploadSubFileLists[" + i + "].BackupFileContent", base64); - } + string base64 = GetBase64Text(fullName); + nvc.Add("UploadSubFileLists[0].BackupFileName", fileName); + nvc.Add("UploadSubFileLists[0].BackupFileContent", base64); bool result = UpLoadBigBackupFileToDB("App/UploadHomeAppGatewaySubFiles", fullName, nvc); if (result == false) @@ -577,13 +574,27 @@ { try { - //鍒犻櫎鏈湴鍏ㄩ儴Log - Global.CreateEmptyDirectory(Path.Combine(DirNameResourse.LocalMemoryDirectory, DirNameResourse.LogDirectory), true); + var listAllFile = HdlAutoBackupLogic.GetFileFromDirectory(upPath); + if (listAllFile.Count > 10) + { + listAllFile.Sort(); + while (listAllFile.Count >= 10) + { + System.IO.File.Delete(listAllFile[0]); + listAllFile.RemoveAt(0); + } + } } catch { } } ProgressFormBar.Current.Close(); + HdlThreadLogic.Current.RunMain(() => + { + var contr = new ShowMsgControl(ShowMsgType.Tip, "Log涓婁紶鎴愬姛"); + contr.Show(); + }); + return result; } -- Gitblit v1.8.0