wxr
2020-09-10 af1cb3ecd0f4b0589e00b28f7f9edccf39e6e12b
HDL_ON/DAL/FileUtils.cs
@@ -16,6 +16,17 @@
        public static string RootPath = Environment.GetFolderPath(System.Environment.SpecialFolder.Personal) + "/";
        /// <summary>
        /// 是否存在文件夹
        /// </summary>
        /// <returns></returns>
        public static bool IsExisFolder(string folderName)
        {
            bool result = false;
            var path = Path.Combine(RootPath, folderName);
            result = Directory.Exists(path);
            return result;
        }
        /// <summary>
        /// 创建一个住宅的备份文件夹
        /// </summary>
        public static string CreateRegionBackup(string regionId)
@@ -45,7 +56,6 @@
            foreach (var fileName in ReadRegionFiles(path))
            {
                File.Delete(Path.Combine(path, fileName));
                MainPage.Log("Del region file :" + fileName);
            }
        }
@@ -75,7 +85,11 @@
            foreach (FileInfo NextFile in thFolders)
            {
                index++;
                if (NextFile.Name == "null" || NextFile.Name == "UserConfig" || NextFile.Name == "Register_File" || NextFile.Name == "AccountListDB")
                if (NextFile.Name == "headImage.png")
                {
                    continue;
                }
                if (NextFile.Name == "null" || NextFile.Name == "UserConfig" || NextFile.Name == "UserInfo_File" || NextFile.Name == "AccountListDB")
                {
                    continue;
                }
@@ -91,7 +105,7 @@
        /// <summary>
        /// 遍历文件
        /// </summary>
        public static List<string> ReadFiles(bool reInit = true)
        public static List<string> ReadFiles()
        {
            List<string> listFiles = new List<string>();
            DirectoryInfo TheFolder = new DirectoryInfo(RootPath);
@@ -99,14 +113,6 @@
            {
                listFiles.Add(NextFile.Name);
            }
            try
            {
                if (reInit)
                {
                    MainPage.LocationFiles = listFiles;
                }
            }
            catch { }
            return listFiles;
        }
@@ -211,10 +217,9 @@
            for (int j = 0; j < filesList.Count; j++)
            {
                var f = filesList[j];
                if (f == "linphonerc" || f == "AccountListDB" || f == "Register_File")
                if (f == "linphonerc" || f == "AccountListDB" || f == "UserInfo_File")
                    continue;
                DeleteFile(f);
                MainPage.Log($"Del file :{f}");
            }
        }