| | |
| | | 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.跳转登录页面 |
| | |
| | | //上传成功 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | Utlis.WriteLine("上传成功:" + imageUrl); |
| | | //Utlis.WriteLine("上传成功:" + imageUrl); |
| | | //1.2如果是自定义图片删除之前的 |
| | | if (!imageView.ImagePath.Contains("LoginIcon/2.png")) |
| | | if (!string.IsNullOrEmpty(imageView.ImagePath) && !imageView.ImagePath.Contains("LoginIcon/2.png")) |
| | | { |
| | | Utlis.WriteLine("删除: " + imageView.ImagePath); |
| | | //Utlis.WriteLine("删除: " + imageView.ImagePath); |
| | | System.IO.File.Delete(imageView.ImagePath); |
| | | } |
| | | //重命名保存 |
| | | FileUtils.WriteFileByBytes(imageUrl, imageBytes); |
| | | imageView.ImagePath = null; |
| | | ImageUtlis.Current.WriteFileByBytes(imageUrl, imageBytes); |
| | | imageView.ImagePath = imageUrl; |
| | | imageView.ImageBytes = imageBytes; |
| | | //上传成功 |
| | | Utlis.ShowTip(Language.StringByID(StringId.UploadSuccessfully)); |