| | |
| | | try |
| | | { |
| | | #region 保存本地数据至文件夹 |
| | | string oldRegionRootPath = FileUtils.CreateRegionBackup(DB_ResidenceData.residenceData.CurReginID.ToString()); |
| | | //清空之前的住宅文件 |
| | | FileUtils.DeleteRegionFiles(oldRegionRootPath); |
| | | var backuplist = FileUtils.ReadFiles(); |
| | | //移动文件 |
| | | foreach (var fileName in backuplist) |
| | | { |
| | | System.IO.FileInfo fileInfo = new System.IO.FileInfo(FileUtils.RootPath + fileName); |
| | | if (fileInfo.Exists) |
| | | { |
| | | fileInfo.MoveTo(oldRegionRootPath + fileName); |
| | | MainPage.Log("move file : " + fileName); |
| | | } |
| | | } |
| | | //string oldRegionRootPath = FileUtils.CreateRegionBackup(DB_ResidenceData.residenceData.CurReginID.ToString()); |
| | | ////清空之前的住宅文件 |
| | | //FileUtils.DeleteRegionFiles(oldRegionRootPath); |
| | | //var backuplist = FileUtils.ReadFiles(); |
| | | ////移动文件 |
| | | //foreach (var fileName in backuplist) |
| | | //{ |
| | | // System.IO.FileInfo fileInfo = new System.IO.FileInfo(FileUtils.RootPath + fileName); |
| | | // if (fileInfo.Exists) |
| | | // { |
| | | // fileInfo.MoveTo(oldRegionRootPath + fileName); |
| | | // MainPage.Log("move file : " + fileName); |
| | | // } |
| | | //} |
| | | #endregion |
| | | } |
| | | catch (Exception ex) |
| | |
| | | } |
| | | finally |
| | | { |
| | | FileUtils.DeleteAllFile(); |
| | | //FileUtils.DeleteAllFile(); |
| | | //2.注销推送 |
| | | new HttpServerRequest().SignOutPush(); |
| | | //3.跳转登录页面 |
| | |
| | | System.IO.File.Delete(imageView.ImagePath); |
| | | } |
| | | //重命名保存 |
| | | FileUtils.WriteFileByBytes(imageUrl, imageBytes); |
| | | Common.FileUtlis.Files.WriteFileByBytes(imageUrl, imageBytes); |
| | | imageView.ImagePath = null; |
| | | imageView.ImageBytes = imageBytes; |
| | | //上传成功 |