| | |
| | | /// <returns></returns>
|
| | | public async Task<string> GetBackFileFromDBAndSetToLocation(string BackupClassId, bool IsGatewayAutoBackup = false, string ZigbeeUniqueId = null)
|
| | | {
|
| | | //不允许按系统的返回键
|
| | | Shared.Common.CommonPage.BackKeyCanClick = false;
|
| | | UserCenterResourse.Option.AppCanSignout = false;
|
| | |
|
| | | //首先先创建一个临时文件夹,存在文件则清空
|
| | | string newDir = System.IO.Path.Combine(DirNameResourse.LocalMemoryDirectory, DirNameResourse.DownLoadBackupTempDirectory);
|
| | | Global.CreateEmptyDirectory(newDir, true);
|
| | |
| | | {
|
| | | //关闭进度条
|
| | | ProgressBar.Close();
|
| | | //允许按系统的返回键
|
| | | Shared.Common.CommonPage.BackKeyCanClick = true;
|
| | | UserCenterResourse.Option.AppCanSignout = true;
|
| | | return null;
|
| | | }
|
| | | //设置最大值
|
| | |
| | | {
|
| | | //关闭进度条
|
| | | ProgressBar.Close(true);
|
| | | //允许按系统的返回键
|
| | | Shared.Common.CommonPage.BackKeyCanClick = true;
|
| | | UserCenterResourse.Option.AppCanSignout = true;
|
| | | return null;
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | //关闭进度条
|
| | | ProgressBar.Close();
|
| | | //允许按系统的返回键
|
| | | Shared.Common.CommonPage.BackKeyCanClick = true;
|
| | | UserCenterResourse.Option.AppCanSignout = true;
|
| | | return null;
|
| | | }
|
| | | //将输入写入本地的临时文件夹
|
| | |
| | | }
|
| | | //关闭进度条
|
| | | ProgressBar.Close();
|
| | | //允许按系统的返回键
|
| | | Shared.Common.CommonPage.BackKeyCanClick = true;
|
| | | UserCenterResourse.Option.AppCanSignout = true;
|
| | |
|
| | | return newDir;
|
| | | }
|
| | |
| | | ProgressBar.Show();
|
| | | }
|
| | |
|
| | | //不允许按系统的返回键
|
| | | Shared.Common.CommonPage.BackKeyCanClick = false;
|
| | | UserCenterResourse.Option.AppCanSignout = false;
|
| | |
|
| | | //你说为什么这里不分一个函数出来(理论上是分函数出来的)
|
| | | //是因为如果分函数的话,会出现双重异步,导致主线程的进度条的百分比永远定死0%
|
| | | foreach (string file in listNormalFile)
|
| | |
| | | {
|
| | | //关闭进度条
|
| | | ProgressBar.Close(true);
|
| | | //允许按系统的返回键
|
| | | Shared.Common.CommonPage.BackKeyCanClick = true;
|
| | | UserCenterResourse.Option.AppCanSignout = true;
|
| | | return false;
|
| | | }
|
| | | //判断是否是应该上传的文件
|
| | |
| | | {
|
| | | //关闭进度条
|
| | | ProgressBar.Close();
|
| | | //允许按系统的返回键
|
| | | Shared.Common.CommonPage.BackKeyCanClick = true;
|
| | | UserCenterResourse.Option.AppCanSignout = true;
|
| | | return false;
|
| | | }
|
| | | //设置进度值
|
| | |
| | | {
|
| | | //关闭进度条
|
| | | ProgressBar.Close(true);
|
| | | //允许按系统的返回键
|
| | | Shared.Common.CommonPage.BackKeyCanClick = true;
|
| | | UserCenterResourse.Option.AppCanSignout = true;
|
| | | return false;
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | //关闭进度条
|
| | | ProgressBar.Close();
|
| | | //允许按系统的返回键
|
| | | Shared.Common.CommonPage.BackKeyCanClick = true;
|
| | | UserCenterResourse.Option.AppCanSignout = true;
|
| | | return false;
|
| | | }
|
| | | //设置进度值
|
| | |
| | |
|
| | | //进度条关闭
|
| | | ProgressBar.Close();
|
| | | //允许按系统的返回键
|
| | | Shared.Common.CommonPage.BackKeyCanClick = true;
|
| | | UserCenterResourse.Option.AppCanSignout = true;
|
| | |
|
| | | return true;
|
| | | }
|
| | |
| | | /// <returns></returns>
|
| | | private string GetBase64Text(string fileName)
|
| | | {
|
| | | string path = UserCenterResourse.LocalRootPath;
|
| | | string path = Config.Instance.FullPath;
|
| | | string fullName = System.IO.Path.Combine(path, fileName);
|
| | |
|
| | | FileStream fs = File.OpenRead(fullName);
|