From 11c4199c6015914b5de6d96fca3b478c0a852f9b Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期四, 03 十二月 2020 19:54:01 +0800
Subject: [PATCH] 2020-12-03 1.OnAppConfig 配置文件检测处理,禁止删除。

---
 HDL_ON/DAL/FileUtils.cs                                 |    8 ++++----
 HDL_ON/Entity/OnAppConfig.cs                            |    8 ++++++--
 HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs |    4 ++--
 .vs/HDL_APP_Project/xs/UserPrefs.xml                    |   15 ++++++++++-----
 4 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml
index 1c7d172..7676b46 100644
--- a/.vs/HDL_APP_Project/xs/UserPrefs.xml
+++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,10 +1,15 @@
 锘�<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
   <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008030-00014C392121802E" />
-  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/MainPage.cs">
+  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/Entity/OnAppConfig.cs">
     <Files>
       <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs" Line="344" Column="45" IsPinned="True" />
-      <File FileName="HDL_ON/Common/ImageUtlis.cs" Line="16" Column="28" />
+      <File FileName="HDL_ON/Common/ImageUtlis.cs" Line="18" Column="8" />
       <File FileName="HDL_ON/UI/MainPage.cs" Line="28" Column="23" />
+      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs" Line="203" Column="42" />
+      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs" Line="1" Column="1" />
+      <File FileName="HDL_ON/DAL/FileUtils.cs" Line="197" Column="122" />
+      <File FileName="HDL_ON/Entity/OnAppConfig.cs" Line="15" Column="50" />
+      <File FileName="HDL_ON/Entity/UserInfo.cs" Line="14" Column="49" />
     </Files>
     <Pads>
       <Pad Id="ProjectPad">
@@ -16,9 +21,10 @@
                 <Node name="DriverLayer" expanded="True" />
                 <Node name="Server" expanded="True" />
               </Node>
-              <Node name="Entity" expanded="True" />
+              <Node name="Entity" expanded="True">
+                <Node name="OnAppConfig.cs" selected="True" />
+              </Node>
               <Node name="UI" expanded="True">
-                <Node name="UI1-Login" expanded="True" />
                 <Node name="UI2" expanded="True">
                   <Node name="3-Intelligence" expanded="True">
                     <Node name="Scene" expanded="True" />
@@ -32,7 +38,6 @@
                     <Node name="UnlockSetting" expanded="True" />
                   </Node>
                 </Node>
-                <Node name="MainPage.cs" selected="True" />
               </Node>
             </Node>
             <Node name="HDL-ON_Android" expanded="True">
diff --git a/HDL_ON/DAL/FileUtils.cs b/HDL_ON/DAL/FileUtils.cs
index 3ca621b..6330ee5 100644
--- a/HDL_ON/DAL/FileUtils.cs
+++ b/HDL_ON/DAL/FileUtils.cs
@@ -79,11 +79,11 @@
             foreach (FileInfo NextFile in thFolders)
             {
                 index++;
-                if (NextFile.Name == "headImage.png")
+                if (NextFile.Name.Contains(ImageUtlis.HEADIMAGE))
                 {
                     continue;
                 }
-                if (NextFile.Name == "null" || NextFile.Name == "UserConfig" || NextFile.Name == "UserInfo_File" || NextFile.Name == "AccountListDB")
+                if (NextFile.Name == "null" || NextFile.Name == "UserConfig" || NextFile.Name == "UserInfo_File" || NextFile.Name == "AccountListDB" || NextFile.Name == OnAppConfig.ConfigFile)
                 {
                     continue;
                 }
@@ -194,7 +194,7 @@
         /// <param name="fileName">File name.</param>
         public static void DeleteFile(string fileName)
         {
-            if (fileName == null || fileName == "Language.ini" || fileName == "AccountListDB")
+            if (fileName == null || fileName == "Language.ini" || fileName == "AccountListDB" || fileName == OnAppConfig.ConfigFile)
             {
                 return;
             }
@@ -211,7 +211,7 @@
             for (int j = 0; j < filesList.Count; j++)
             {
                 var f = filesList[j];
-                if (f == "linphonerc" || f == "AccountListDB" || f == "UserInfo_File")
+                if (f == "linphonerc" || f == "AccountListDB" || f == "UserInfo_File" || f == OnAppConfig.ConfigFile)
                     continue;
                 DeleteFile(f);
             }
diff --git a/HDL_ON/Entity/OnAppConfig.cs b/HDL_ON/Entity/OnAppConfig.cs
index 4446f29..1c20b4f 100644
--- a/HDL_ON/Entity/OnAppConfig.cs
+++ b/HDL_ON/Entity/OnAppConfig.cs
@@ -9,13 +9,17 @@
     [System.Serializable]
     public class OnAppConfig
     {
+        /// <summary>
+        /// 鐢ㄦ埛澶村儚
+        /// </summary>
+        public const string ConfigFile = "OnAppConfig";
 
         static OnAppConfig instance;
         public static OnAppConfig Instance {
             get {
                 if (instance == null) {
                     try {
-                        var userConfigBytes = FileUtils.ReadFile ("OnAppConfig");
+                        var userConfigBytes = FileUtils.ReadFile (ConfigFile);
                         var userConfigString = System.Text.Encoding.UTF8.GetString (userConfigBytes);
                         OnAppConfig temp = null;
                         if (userConfigString != null) {
@@ -51,7 +55,7 @@
 
         public void SaveUserConfig ()
         {
-            FileUtils.WriteFileByBytes ("OnAppConfig", GetUserConfigBytes ());
+            FileUtils.WriteFileByBytes (ConfigFile, GetUserConfigBytes ());
         }
         /// <summary>
         /// 淇℃伅鎺ㄩ�佹爣璁�
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs
index 9dfbe49..57ddfd5 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs
@@ -200,7 +200,7 @@
                     foreach (var fileName in backuplist)
                     {
                         System.IO.FileInfo fileInfo = new System.IO.FileInfo(FileUtils.RootPath + fileName);
-                        if (fileName == "headImage.png")
+                        if (fileName.Contains(ImageUtlis.HEADIMAGE) || fileName == OnAppConfig.ConfigFile)
                         {
                             continue;
                         }
@@ -219,7 +219,7 @@
                     //鍒犻櫎鏈湴鏂囦欢
                     foreach (var fileName in backuplist)
                     {
-                        if (fileName == "headImage.png")
+                        if (fileName.Contains(ImageUtlis.HEADIMAGE))
                         {
                             continue;
                         }

--
Gitblit v1.8.0