From 93cc15fbef77be70509f60189578384575460495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E6=80=A1=E9=A3=9E?= <49179966+Gaoyifei1011@users.noreply.github.com> Date: Sun, 1 Jan 2023 22:37:13 +0800 Subject: [PATCH] 2023 First Commit 2023 First Commit 1.Finish task and publish 0.8.0.0 version 2.Completed console application --- Description/README_EN-US.md | 7 +- Description/README_ZH-CN.md | 7 +- GetStoreApp/GetStoreApp.csproj | 6 +- .../Controls/Download/Aria2ProcessHelper.cs | 6 + GetStoreApp/Helpers/Root/InfoHelper.cs | 9 +- GetStoreApp/Program.cs | 6 +- .../Services/Root/ConsoleLaunchService.cs | 17 +- GetStoreApp/Services/Root/ResourceService.cs | 2 +- GetStoreApp/Services/Shell/DownloadService.cs | 159 ++++++++++++++++++ GetStoreApp/Services/Shell/ParseService.cs | 69 +++++++- GetStoreApp/Services/Shell/RequestService.cs | 62 +++---- GetStoreApp/Strings/en-us/Console.resw | 31 +++- GetStoreApp/Strings/en-us/Resources.resw | 6 +- GetStoreApp/Strings/en-us/Window.resw | 2 +- GetStoreApp/Strings/zh-hans/Console.resw | 29 +++- GetStoreApp/Strings/zh-hans/Resources.resw | 6 +- GetStoreApp/Strings/zh-hans/Window.resw | 2 +- GetStoreAppPackage/Package.appxmanifest | 2 +- README.md | 8 +- 19 files changed, 349 insertions(+), 87 deletions(-) create mode 100644 GetStoreApp/Services/Shell/DownloadService.cs diff --git a/Description/README_EN-US.md b/Description/README_EN-US.md index b6c7da0f..e49241bc 100644 --- a/Description/README_EN-US.md +++ b/Description/README_EN-US.md @@ -38,14 +38,13 @@ Note: The app can't bypass the Microsoft Store's billing channels, and if the ap | ---------------------------------------------------------| -------------------------------------------------------------------------------------------------------------------| | Main page functionality | Completed | | History (records used links) | Completed | -| Download the file from the generated link | Completed (in beta) | +| Download the file from the generated link | Completed | | Deploy the app offline after the download is complete | Completed | | Access the web version of the docking download interface | Completed | -| Console applications (quickly download and deploy) | Planning (Expected 0.8.0 preview implementation) | +| Console applications (quickly download) | Completed | | Program performance optimization | Planning (Expected to be implemented in version 1.0.0) | -> * At present, the application is in the development stage, some functions have not yet been implemented, and only basic functions are currently provided. In addition, I am a beginner in C#, and I am more time-constrained, I can only use my spare time to develop, the development progress is relatively slow, please understand. -> * The download function is in the testing stage, there may be instability during use, if there is an abnormality during use, please use a browser to download. +> * I am a beginner in C#, and I am more time-constrained, I can only use my spare time to develop, the development progress is relatively slow, please understand. ------ diff --git a/Description/README_ZH-CN.md b/Description/README_ZH-CN.md index db27fc59..3cd82e26 100644 --- a/Description/README_ZH-CN.md +++ b/Description/README_ZH-CN.md @@ -38,14 +38,13 @@ | --------------------------------| --------------------------------------------------| | 主页面功能 | 已完成 | | 历史记录(记录使用过的链接) | 已完成 | -| 通过生成的链接下载文件 | 已完成(处于测试阶段) | +| 通过生成的链接下载文件 | 已完成 | | 下载完成后离线部署应用 | 已完成 | | 访问网页版对接下载接口 | 已完成 | -| 控制台应用程序(快速下载并部署)| 计划中(预计0.8.0预览版本实现) | +| 控制台应用程序(快速下载) | 已完成 | | 程序性能优化 | 计划中(预计1.0.0正式版本实现) | -> * 目前该应用处于开发阶段,有部分功能尚未实现,目前仅提供基础的功能。此外我是c#的初学者,且本人时间较为紧张,只能利用自己的闲余时间开发,开发进度较为缓慢,请谅解。 -> * 下载功能处于测试阶段,在使用过程中可能存在不稳定现象,如果在使用过程中出现异常,请使用浏览器下载。 +> * 我是c#的初学者,且本人时间较为紧张,只能利用自己的闲余时间开发,开发进度较为缓慢,请谅解。 ------ diff --git a/GetStoreApp/GetStoreApp.csproj b/GetStoreApp/GetStoreApp.csproj index 0fa61f27..dd224cde 100644 --- a/GetStoreApp/GetStoreApp.csproj +++ b/GetStoreApp/GetStoreApp.csproj @@ -11,7 +11,7 @@ true True 512 - 0.7.3.0 + 0.8.0.0 True False disable @@ -22,7 +22,7 @@ x86;x64;ARM64 Properties\PublishProfiles\win10-$(Platform).pubxml FileSystem - False + True false true PackageReference @@ -33,7 +33,7 @@ net7.0-windows10.0.22621.0 10.0.17763.0 partial - 0.7.3.0 + 0.8.0.0 true false MSIX diff --git a/GetStoreApp/Helpers/Controls/Download/Aria2ProcessHelper.cs b/GetStoreApp/Helpers/Controls/Download/Aria2ProcessHelper.cs index 40d572ea..30477241 100644 --- a/GetStoreApp/Helpers/Controls/Download/Aria2ProcessHelper.cs +++ b/GetStoreApp/Helpers/Controls/Download/Aria2ProcessHelper.cs @@ -84,6 +84,9 @@ public static void KillProcessAndChildren(int processID) } } + /// + /// 获取所有的子进程ID + /// public static List GetChildProcessIds(int parentProcessId) { List myChildrenProcessList = new List(); @@ -108,6 +111,9 @@ public static List GetChildProcessIds(int parentProcessId) return myChildrenProcessList; } + /// + /// 获取父进程ID + /// public static int GetParentProcessId(int processId) { int ParentID = 0; diff --git a/GetStoreApp/Helpers/Root/InfoHelper.cs b/GetStoreApp/Helpers/Root/InfoHelper.cs index 28816602..3ad89fba 100644 --- a/GetStoreApp/Helpers/Root/InfoHelper.cs +++ b/GetStoreApp/Helpers/Root/InfoHelper.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Threading.Tasks; using Windows.ApplicationModel; using Windows.System; using Windows.System.Profile; @@ -20,7 +19,7 @@ public static class InfoHelper /// /// 初始化系统版本信息 /// - public static async Task InitializeSystemVersionAsync() + public static void InitializeSystemVersion() { ulong VersionInfo = ulong.Parse(SystemVersion); @@ -33,14 +32,12 @@ public static async Task InitializeSystemVersionAsync() SystemVersionDict.Add(nameof(MinorVersion), MinorVersion); SystemVersionDict.Add(nameof(BuildNumber), BuildNumber); SystemVersionDict.Add(nameof(BuildRevision), BuildRevision); - - await Task.CompletedTask; } /// /// 初始化应用版本信息 /// - public static async Task InitializeAppVersionAsync() + public static void InitializeAppVersion() { ushort MajorVersion = Package.Current.Id.Version.Major; ushort MinorVersion = Package.Current.Id.Version.Minor; @@ -51,8 +48,6 @@ public static async Task InitializeAppVersionAsync() AppVersionDict.Add(nameof(MinorVersion), MinorVersion); AppVersionDict.Add(nameof(BuildVersion), BuildVersion); AppVersionDict.Add(nameof(RevisionVersion), RevisionVersion); - - await Task.CompletedTask; } /// diff --git a/GetStoreApp/Program.cs b/GetStoreApp/Program.cs index 5ad967b8..2fb59af3 100644 --- a/GetStoreApp/Program.cs +++ b/GetStoreApp/Program.cs @@ -85,9 +85,10 @@ public static async Task InitializeProgramResourcesAsync() await RegionService.InitializeRegionAsync(); await LinkFilterService.InitializeLinkFilterValueAsnyc(); + await DownloadOptionsService.InitializeAsync(); - await InfoHelper.InitializeAppVersionAsync(); - await InfoHelper.InitializeSystemVersionAsync(); + InfoHelper.InitializeAppVersion(); + InfoHelper.InitializeSystemVersion(); if (IsDesktopProgram) { @@ -104,7 +105,6 @@ public static async Task InitializeProgramResourcesAsync() await ThemeService.InitializeThemeAsync(); await TopMostService.InitializeTopMostValueAsync(); - await DownloadOptionsService.InitializeAsync(); await HistoryLiteNumService.InitializeHistoryLiteNumAsync(); await NotificationService.InitializeNotificationAsync(); await UseInstructionService.InitializeUseInsVisValueAsync(); diff --git a/GetStoreApp/Services/Root/ConsoleLaunchService.cs b/GetStoreApp/Services/Root/ConsoleLaunchService.cs index 2c975ef7..ef4ca38c 100644 --- a/GetStoreApp/Services/Root/ConsoleLaunchService.cs +++ b/GetStoreApp/Services/Root/ConsoleLaunchService.cs @@ -14,11 +14,17 @@ namespace GetStoreApp.Services.Root /// public static class ConsoleLaunchService { - /// - /// 换行符 - /// + // 换行符 public static string LineBreaks = "\r\n"; + // 行分隔符 + public static char RowSplitCharacter = ' '; + + // 列分隔符 + public static char ColumnSplitCharacter = '-'; + + public static bool IsAppRunning = true; + /// /// 应用启动时使用的参数 /// @@ -38,6 +44,8 @@ public static async Task InitializeConsoleStartupAsync() InitializeIntroduction(); InitializeRequestContent(); await RequestService.GetLinksAsync(); + + Console.WriteLine(LineBreaks + ResourceService.GetLocalized("/Console/ApplicationExit")); } /// @@ -67,6 +75,9 @@ private static void OnConsoleCancelKeyPress(object sender, ConsoleCancelEventArg } if (Result == MessageBoxResult.IDOK) { + Console.WriteLine(LineBreaks + ResourceService.GetLocalized("/Console/ApplicationExit")); + IsAppRunning = false; + DownloadService.StopDownloadFile(); Environment.Exit(Convert.ToInt32(AppExitCode.Successfully)); } } diff --git a/GetStoreApp/Services/Root/ResourceService.cs b/GetStoreApp/Services/Root/ResourceService.cs index 2f05501b..1691cee3 100644 --- a/GetStoreApp/Services/Root/ResourceService.cs +++ b/GetStoreApp/Services/Root/ResourceService.cs @@ -322,7 +322,7 @@ private static void InitializeTraceCleanupList() } /// - /// UI字符串本地化 + /// 字符串本地化 /// public static string GetLocalized(string resource) { diff --git a/GetStoreApp/Services/Shell/DownloadService.cs b/GetStoreApp/Services/Shell/DownloadService.cs new file mode 100644 index 00000000..b9eec3b6 --- /dev/null +++ b/GetStoreApp/Services/Shell/DownloadService.cs @@ -0,0 +1,159 @@ +using GetStoreApp.Helpers.Controls.Download; +using GetStoreApp.Services.Controls.Settings.Common; +using GetStoreApp.Services.Root; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Windows.System; + +namespace GetStoreApp.Services.Shell +{ + /// + /// 下载服务 + /// + public static class DownloadService + { + private static string Aria2FilePath => Path.Combine(AppContext.BaseDirectory, @"Aria2\Aria2c.exe"); + + private static bool IsFileDownloading; + + private static int Aria2ProcessId; + + /// + /// 下载相应的文件 + /// + public static async Task QueryDownloadIndexAsync() + { + while (true) + { + Console.WriteLine(ResourceService.GetLocalized("/Console/DownloadFile")); + List IndexList = Console.ReadLine().Split(',').ToList(); + try + { + bool CheckResult = true; + foreach (string indexItem in IndexList) + { + int index = Convert.ToInt32(indexItem); + if (index > ParseService.ResultDataList.Count || index < 1) + { + CheckResult = false; + break; + } + } + + if (CheckResult) + { + for (int index = 0; index < IndexList.Count; index++) + { + string IndexItem = IndexList[index]; + if (ConsoleLaunchService.IsAppRunning) + { + Console.WriteLine(ResourceService.GetLocalized("/Console/DownloadingInformation"), index + 1, IndexList.Count); + await DownloadFileAsync(ParseService.ResultDataList[Convert.ToInt32(IndexItem) - 1].FileLink); + } + } + Console.WriteLine(ResourceService.GetLocalized("/Console/DownloadCompleted")); + string InputString = Console.ReadLine(); + if (InputString == "Y" || InputString == "y") + { + continue; + } + else + { + Console.WriteLine(ResourceService.GetLocalized("/Console/OpenFolder")); + await OpenDownloadFolderAsync(); + break; + } + } + else + { + Console.WriteLine(ResourceService.GetLocalized("/Console/SerialNumberOutRange")); + string InputString = Console.ReadLine(); + if (InputString == "Y" || InputString == "y") + { + continue; + } + else + { + break; + } + } + } + catch (Exception) + { + Console.WriteLine(ResourceService.GetLocalized("/Console/SerialNumberError")); + string InputString = Console.ReadLine(); + if (InputString == "Y" || InputString == "y") + { + continue; + } + else + { + break; + } + } + } + } + + /// + /// 下载文件 + /// + private static async Task DownloadFileAsync(string fileLink) + { + ProcessStartInfo Aria2Info = new ProcessStartInfo() + { + FileName = Aria2FilePath, + + RedirectStandardOutput = true, + RedirectStandardError = true, + UseShellExecute = false, + CreateNoWindow = true, + + WindowStyle = ProcessWindowStyle.Hidden, + Arguments = string.Format("--file-allocation=none -d \"{0}\" {1}", DownloadOptionsService.DownloadFolder.Path, fileLink) + }; + + StreamReader streamReader; + + Process Aria2Process = new Process(); + Aria2Process.StartInfo = Aria2Info; + Aria2Process.Start(); + IsFileDownloading = true; + Aria2ProcessId = Aria2Process.Id; + streamReader = Aria2Process.StandardOutput; + while (!streamReader.EndOfStream) + { + char[] bs = new char[16]; + streamReader.Read(bs, 0, 16); + foreach (char o in bs) + { + Console.Write(o); + } + } + await Aria2Process.WaitForExitAsync(); + Aria2Process.Close(); + } + + /// + /// 打开下载完成后保存的目录 + /// + private static async Task OpenDownloadFolderAsync() + { + await Launcher.LaunchFolderAsync(DownloadOptionsService.DownloadFolder); + } + + /// + /// 程序即将退出,停止下载文件 + /// + public static void StopDownloadFile() + { + if (IsFileDownloading) + { + Aria2ProcessHelper.KillProcessAndChildren(Aria2ProcessId); + } + } + } +} diff --git a/GetStoreApp/Services/Shell/ParseService.cs b/GetStoreApp/Services/Shell/ParseService.cs index cb8b6a79..621c0379 100644 --- a/GetStoreApp/Services/Shell/ParseService.cs +++ b/GetStoreApp/Services/Shell/ParseService.cs @@ -1,8 +1,12 @@ -using GetStoreApp.Helpers.Controls.Home; +using GetStoreApp.Extensions.Console; +using GetStoreApp.Helpers.Controls.Home; using GetStoreApp.Models.Controls.Home; using GetStoreApp.Services.Controls.Settings.Common; +using GetStoreApp.Services.Root; using System; using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; namespace GetStoreApp.Services.Shell { @@ -13,14 +17,13 @@ public static class ParseService { private static string CategoryId = string.Empty; - private static List ResultDataList = new List(); + public static List ResultDataList = new List(); /// /// 解析或得到的数据 /// - public static void ParseData(RequestModel requestData) + public static async Task ParseDataAsync(RequestModel requestData) { - CategoryId = string.Empty; ResultDataList.Clear(); HtmlParseHelper.InitializeParseData(requestData); @@ -29,6 +32,10 @@ public static void ParseData(RequestModel requestData) ResultDataList = HtmlParseHelper.HtmlParseLinks(); ResultListFilter(ref ResultDataList); + + PrintCategoryID(); + PrintResultList(); + await DownloadService.QueryDownloadIndexAsync(); } /// @@ -52,5 +59,59 @@ private static void ResultListFilter(ref List resultDataList) resultDataList.RemoveAll(item => item.FileName.EndsWith("blockmap", StringComparison.OrdinalIgnoreCase)); } } + + /// + /// 向控制台输出获取到CategoryID + /// + private static void PrintCategoryID() + { + Console.Write(ResourceService.GetLocalized("/Console/CategoryID") + CategoryId + ConsoleLaunchService.LineBreaks); + } + + /// + /// 向控制台输出获取到的结果列表 + /// + private static void PrintResultList() + { + string SerialNumberHeader = ResourceService.GetLocalized("/Console/SerialNumber"); + string FileNameHeader = ResourceService.GetLocalized("/Console/FileName"); + string FileSizeHeader = ResourceService.GetLocalized("/Console/FileSize"); + + int SerialNumberHeaderLength = CharExtension.GetStringDisplayLengthEx(SerialNumberHeader); + int FileNameHeaderLength = CharExtension.GetStringDisplayLengthEx(FileNameHeader); + int FileSizeHeaderLength = CharExtension.GetStringDisplayLengthEx(FileSizeHeader); + + int SerialNumberColumnLength = (SerialNumberHeaderLength > ResultDataList.Count.ToString().Length ? SerialNumberHeaderLength : ResultDataList.Count.ToString().Length) + 3; + + int FileNameContentMaxLength = 0; + foreach (ResultModel resultItem in ResultDataList.Where(resultItem => resultItem.FileName.Length > FileNameContentMaxLength)) + { + FileNameContentMaxLength = resultItem.FileName.Length; + } + int FileNameColumnLength = ((FileNameHeaderLength > FileNameContentMaxLength) ? FileNameHeaderLength : FileNameContentMaxLength) + 3; + + Console.Write(ConsoleLaunchService.LineBreaks); + Console.WriteLine(ResourceService.GetLocalized("/Console/ResultDataList")); + + // 打印标题 + Console.Write(SerialNumberHeader + new string(ConsoleLaunchService.RowSplitCharacter, SerialNumberColumnLength - SerialNumberHeaderLength)); + Console.Write(FileNameHeader + new string(ConsoleLaunchService.RowSplitCharacter, FileNameColumnLength - FileNameHeaderLength)); + Console.Write(FileSizeHeader + ConsoleLaunchService.LineBreaks); + + // 打印标题与内容的分割线 + Console.Write(new string(ConsoleLaunchService.ColumnSplitCharacter, SerialNumberHeaderLength).PadRight(SerialNumberColumnLength)); + Console.Write(new string(ConsoleLaunchService.ColumnSplitCharacter, FileNameHeaderLength).PadRight(FileNameColumnLength)); + Console.Write(new string(ConsoleLaunchService.ColumnSplitCharacter, FileSizeHeaderLength) + ConsoleLaunchService.LineBreaks); + + // 打印内容 + for (int resultDataIndex = 0; resultDataIndex < ResultDataList.Count; resultDataIndex++) + { + Console.Write(Convert.ToString(resultDataIndex + 1) + new string(ConsoleLaunchService.RowSplitCharacter, SerialNumberColumnLength - Convert.ToString(resultDataIndex + 1).Length)); + Console.Write(ResultDataList[resultDataIndex].FileName + new string(ConsoleLaunchService.RowSplitCharacter, FileNameColumnLength - ResultDataList[resultDataIndex].FileName.Length)); + Console.Write(ResultDataList[resultDataIndex].FileSize + ConsoleLaunchService.LineBreaks); + } + + Console.Write(ConsoleLaunchService.LineBreaks); + } } } diff --git a/GetStoreApp/Services/Shell/RequestService.cs b/GetStoreApp/Services/Shell/RequestService.cs index 56ef04bc..940516ae 100644 --- a/GetStoreApp/Services/Shell/RequestService.cs +++ b/GetStoreApp/Services/Shell/RequestService.cs @@ -98,8 +98,8 @@ public static async Task GetLinksAsync() Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine(ResourceService.GetLocalized("/Console/RequestSuccessfully")); Console.ResetColor(); - RequestState = true; - // 解析内容并打印输出 + RequestState = false; + await ParseService.ParseDataAsync(httpRequestData); break; } case 2: @@ -144,56 +144,36 @@ private static void OnRequestElasped(object sender, ElapsedEventArgs args) /// private static void PrintRequestFailedData() { - int Column1EmptyLength = 10; - int Column2EmptyLength = 15; - + string SerialNumberHeader = ResourceService.GetLocalized("/Console/SerialNumber"); string FileNameHeader = ResourceService.GetLocalized("/Console/FileName"); - string FileSizeHeader = ResourceService.GetLocalized("/Console/FileSIze"); + string FileSizeHeader = ResourceService.GetLocalized("/Console/FileSize"); string None = ResourceService.GetLocalized("/Console/None"); - string SerialNumberHeader = ResourceService.GetLocalized("/Console/SerialNumber"); + int SerialNumberHeaderLength = CharExtension.GetStringDisplayLengthEx(SerialNumberHeader); int FileNameHeaderLength = CharExtension.GetStringDisplayLengthEx(FileNameHeader); + int FileSizeHeaderLength = CharExtension.GetStringDisplayLengthEx(FileSizeHeader); int NoneLength = CharExtension.GetStringDisplayLength(None); - int SerialNumberHeaderLength = CharExtension.GetStringDisplayLengthEx(SerialNumberHeader); - Console.Write(ConsoleLaunchService.LineBreaks); + int SerialNumberColumnLength = (SerialNumberHeaderLength > "1".Length ? SerialNumberHeaderLength : "1".Length) + 3; + int FileNameColumnLength = (FileNameHeaderLength > NoneLength ? FileNameHeaderLength : NoneLength) + 3; - Console.Write(SerialNumberHeader); - if (SerialNumberHeaderLength < Column1EmptyLength) - { - Console.Write(new string(' ', Column1EmptyLength - SerialNumberHeaderLength)); - } + Console.Write(ConsoleLaunchService.LineBreaks); + Console.WriteLine(ResourceService.GetLocalized("/Console/ResultDataList")); - Console.Write(FileNameHeader); - if (SerialNumberHeaderLength < Column2EmptyLength) - { - Console.Write(new string(' ', Column2EmptyLength - FileNameHeaderLength)); - } + // 打印标题 + Console.Write(SerialNumberHeader + new string(ConsoleLaunchService.RowSplitCharacter, SerialNumberColumnLength - SerialNumberHeaderLength)); + Console.Write(FileNameHeader + new string(ConsoleLaunchService.RowSplitCharacter, FileNameColumnLength - FileNameHeaderLength)); Console.Write(FileSizeHeader + ConsoleLaunchService.LineBreaks); - Console.Write(new string('-', CharExtension.GetStringDisplayLengthEx(SerialNumberHeader)).PadRight(Column1EmptyLength)); - Console.Write(new string('-', CharExtension.GetStringDisplayLengthEx(FileNameHeader)).PadRight(Column2EmptyLength)); - Console.Write(new string('-', CharExtension.GetStringDisplayLengthEx(FileSizeHeader)) + ConsoleLaunchService.LineBreaks); - - if (SerialNumberHeaderLength < Column1EmptyLength) - { - Console.Write("1" + new string(' ', Column1EmptyLength - 1)); - } - else - { - Console.Write("1" + new string(' ', SerialNumberHeaderLength - 1)); - } - - if (FileNameHeaderLength < Column2EmptyLength) - { - Console.Write(None + new string(' ', Column2EmptyLength - NoneLength)); - } - else - { - Console.Write(None + new string(' ', FileNameHeaderLength - NoneLength)); - } + // 打印标题与内容的分割线 + Console.Write(new string(ConsoleLaunchService.ColumnSplitCharacter, SerialNumberHeaderLength).PadRight(SerialNumberColumnLength)); + Console.Write(new string(ConsoleLaunchService.ColumnSplitCharacter, FileNameHeaderLength).PadRight(FileNameColumnLength)); + Console.Write(new string(ConsoleLaunchService.ColumnSplitCharacter, FileSizeHeaderLength) + ConsoleLaunchService.LineBreaks); - Console.WriteLine(ResourceService.GetLocalized("/Console/None") + ConsoleLaunchService.LineBreaks); + // 输出内容 + Console.Write("1" + new string(ConsoleLaunchService.RowSplitCharacter, SerialNumberColumnLength - 1)); + Console.Write(None + new string(ConsoleLaunchService.RowSplitCharacter, FileNameColumnLength - NoneLength)); + Console.Write(None + ConsoleLaunchService.LineBreaks); } } } diff --git a/GetStoreApp/Strings/en-us/Console.resw b/GetStoreApp/Strings/en-us/Console.resw index 245656b5..bdb8c8e6 100644 --- a/GetStoreApp/Strings/en-us/Console.resw +++ b/GetStoreApp/Strings/en-us/Console.resw @@ -117,12 +117,27 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + The program is exiting... + - Do you want to try to get it again? (Make sure to enter "Y", exit entering other characters) + Do you want to try to get it again? (Make sure to input "Y", exit entering other characters) + + + CategoryID: There are four channels for download links: 1. Fast, 2. Slow, 3. Release Preview, and 4. Official Version + + All files have been downloaded, do you want to download other files? (Make sure to input "Y", exit entering other characters) + + + Please input the serial number of the file you want to download, and if there are multiple files downloaded, separate them with English commas(",") + + + Downloading {0} file, {1} files in total + Are you sure want to quit? @@ -153,6 +168,9 @@ None + + Opening the downloaded folder, please wait... + The parameters you inputed are incorrect, please check the parameters you inputed @@ -165,6 +183,9 @@ These links were successfully received from the servers of the Microsoft Store + + File information list + Please enter the channel you want to select (the default is production): @@ -174,8 +195,14 @@ Serial number + + You entered the wrong serial number, do you want to re-enter it? (Make sure to input "Y", exit entering other characters) + + + You inputed the serial number that is out of range, entered it incorrectly, do you want to re-input it? (Make sure to input "Y", exit entering other characters) + - GetStoreApp (Dev) + GetStoreApp There are four types of acquisition apps:1. URL (link), 2.ProductID, 3.PackageFamilyName, 4.CategoryID diff --git a/GetStoreApp/Strings/en-us/Resources.resw b/GetStoreApp/Strings/en-us/Resources.resw index 7d744c3e..3d1af4dd 100644 --- a/GetStoreApp/Strings/en-us/Resources.resw +++ b/GetStoreApp/Strings/en-us/Resources.resw @@ -118,13 +118,13 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - GetStoreApp (Dev) + GetStoreApp - GetStoreApp (Dev) + GetStoreApp - GetStoreApp (Dev) + GetStoreApp GetStoreApp diff --git a/GetStoreApp/Strings/en-us/Window.resw b/GetStoreApp/Strings/en-us/Window.resw index 0351fa46..69065ad2 100644 --- a/GetStoreApp/Strings/en-us/Window.resw +++ b/GetStoreApp/Strings/en-us/Window.resw @@ -121,7 +121,7 @@ About - GetStoreApp (Dev) + GetStoreApp Download Management diff --git a/GetStoreApp/Strings/zh-hans/Console.resw b/GetStoreApp/Strings/zh-hans/Console.resw index fdeec65a..b22150b6 100644 --- a/GetStoreApp/Strings/zh-hans/Console.resw +++ b/GetStoreApp/Strings/zh-hans/Console.resw @@ -117,12 +117,27 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 程序正在退出... + 您是否想要尝试重新获取?(确定输入“Y”,退出输入其他字符) + + CategoryID: + 下载链接共有四种通道:1.快速、2.慢速、3.发布预览、4.正式版 + + 所有文件都已经下载完成,是否要下载其他文件?(确定输入“Y”,退出输入其他字符) + + + 请输入您要下载文件的序号,如果有多个文件下载请使用英文逗号隔开(“,”) + + + 正在下载第{0}个文件,共{1}个文件 + 您确定要退出吗? @@ -153,6 +168,9 @@ + + 正在打开已下载完成的目录,请稍候... + 您输入的参数有误,请检查您输入的参数 @@ -165,6 +183,9 @@ 已成功从微软商店的服务器中接收到这些链接 + + 文件信息列表 + 请输入您要选择的通道(默认选择正式版): @@ -174,8 +195,14 @@ 序号 + + 您输入的序号格式有误,是否要重新输入?(确定输入“Y”,退出输入其他字符) + + + 您输入的序号已经超出了范围,输入有误,是否要重新输入?(确定输入“Y”,退出输入其他字符) + - 获取商店应用 (Dev) + 获取商店应用 获取应用有四种类型:1.URL(链接)、2.ProductID、3.PackageFamilyName、4.CategoryID diff --git a/GetStoreApp/Strings/zh-hans/Resources.resw b/GetStoreApp/Strings/zh-hans/Resources.resw index 6d22715f..a321113b 100644 --- a/GetStoreApp/Strings/zh-hans/Resources.resw +++ b/GetStoreApp/Strings/zh-hans/Resources.resw @@ -118,10 +118,10 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 获取商店应用 (Dev) + 获取商店应用 - 获取商店应用 (Dev) + 获取商店应用 应用程序正在运行中。 @@ -145,7 +145,7 @@ 确定 - 获取商店应用 (Dev) + 获取商店应用 PackageFamilyName diff --git a/GetStoreApp/Strings/zh-hans/Window.resw b/GetStoreApp/Strings/zh-hans/Window.resw index fe3eb10c..b3d2240b 100644 --- a/GetStoreApp/Strings/zh-hans/Window.resw +++ b/GetStoreApp/Strings/zh-hans/Window.resw @@ -121,7 +121,7 @@ 关于 - 获取商店应用 (Dev) + 获取商店应用 下载管理 diff --git a/GetStoreAppPackage/Package.appxmanifest b/GetStoreAppPackage/Package.appxmanifest index 0ac68a12..55f6bd12 100644 --- a/GetStoreAppPackage/Package.appxmanifest +++ b/GetStoreAppPackage/Package.appxmanifest @@ -14,7 +14,7 @@ + Version="0.8.0.0" /> ms-resource:PackageDisplayName diff --git a/README.md b/README.md index 42c0c154..f2ad0eaf 100644 --- a/README.md +++ b/README.md @@ -45,15 +45,13 @@ | --------------------------------| --------------------------------------------------| | 主页面功能 | 已完成 | | 历史记录(记录使用过的链接) | 已完成 | -| 通过生成的链接下载文件 | 已完成(处于测试阶段) | +| 通过生成的链接下载文件 | 已完成 | | 下载完成后离线部署应用 | 已完成 | | 访问网页版对接下载接口 | 已完成 | -| 控制台应用程序(快速下载并部署)| 计划中(预计0.8.0预览版本实现) | +| 控制台应用程序(快速下载) | 已完成 | | 程序性能优化 | 计划中(预计1.0.0正式版本实现) | -> * 目前该应用处于开发阶段,有部分功能尚未实现,目前仅提供基础的功能。此外我是c#的初学者,且本人时间较为紧张,只能利用自己的闲余时间开发,开发进度较为缓慢,请谅解。 -> * 下载功能处于测试阶段,在使用过程中可能存在不稳定现象,如果在使用过程中出现异常,请使用浏览器下载。 - +> * 我是c#的初学者,且本人时间较为紧张,只能利用自己的闲余时间开发,开发进度较为缓慢,请谅解。 ------ ### 项目引用(按英文首字母排序)