Skip to content

Commit

Permalink
修改了字典的分隔符,可以兼容大部分换行符
Browse files Browse the repository at this point in the history
  • Loading branch information
dawn-lc committed Feb 8, 2021
1 parent fed2819 commit 1162572
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 20 deletions.
11 changes: 10 additions & 1 deletion ArchivePasswordTestTool.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30523.141
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArchivePasswordTestTool", "ArchivePasswordTestTool.csproj", "{EA7F6A54-6730-4262-8497-B5DDC1830A5C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ArchivePasswordTestTool", "ArchivePasswordTestTool.csproj", "{EA7F6A54-6730-4262-8497-B5DDC1830A5C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArchivePasswordTestToolGUI", "..\ArchivePasswordTestToolGUI\ArchivePasswordTestToolGUI.csproj", "{A2469696-873D-4B0E-B2F1-37C7CB770681}"
ProjectSection(ProjectDependencies) = postProject
{EA7F6A54-6730-4262-8497-B5DDC1830A5C} = {EA7F6A54-6730-4262-8497-B5DDC1830A5C}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -15,6 +20,10 @@ Global
{EA7F6A54-6730-4262-8497-B5DDC1830A5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EA7F6A54-6730-4262-8497-B5DDC1830A5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EA7F6A54-6730-4262-8497-B5DDC1830A5C}.Release|Any CPU.Build.0 = Release|Any CPU
{A2469696-873D-4B0E-B2F1-37C7CB770681}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A2469696-873D-4B0E-B2F1-37C7CB770681}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A2469696-873D-4B0E-B2F1-37C7CB770681}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A2469696-873D-4B0E-B2F1-37C7CB770681}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
40 changes: 21 additions & 19 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public ProgramParameter()
ProgramParameter.DebugMode = false;
ProgramParameter.FastDebugMode = false;
}
public static readonly int[] Version = new int[] { 1, 0, 4 };
public static readonly int[] Version = new int[] { 1, 0, 5 };
public static readonly string VersionType = "Release";
public static readonly string Developer = "dawn-lc";
public static readonly string AppName = Assembly.GetExecutingAssembly().FullName.Substring(0, Assembly.GetExecutingAssembly().FullName.IndexOf(","));
Expand Down Expand Up @@ -215,24 +215,24 @@ private static bool CompareVersionType(string sourceVersionType, string targetVe
public static void Upgrade()
{
Console.WriteLine("有可用的更新!是否前往查看?");
while (true)
{
Console.Write("(按Y前往查看更新/按N退出): ");
switch (Console.ReadKey().Key)
while (true)
{
case ConsoleKey.Y:
Console.Clear();
Process.Start(ProgramParameter.AppHomePage);
break;
case ConsoleKey.N:
return;
default:
Console.WriteLine();
Console.WriteLine("输入错误!");
continue;
Console.Write("(按Y前往查看更新/按N退出): ");
switch (Console.ReadKey().Key)
{
case ConsoleKey.Y:
Console.Clear();
Process.Start(ProgramParameter.AppHomePage);
break;
case ConsoleKey.N:
return;
default:
Console.WriteLine();
Console.WriteLine("输入错误!");
continue;
}
break;
}
break;
}
}
public static void CheckUpgrade()
{
Expand Down Expand Up @@ -277,7 +277,8 @@ public static void CheckUpgrade()
}
else
{
Console.WriteLine("当前已是最新版本。[" + string.Join(".", ProgramParameter.Version) + "-" + ProgramParameter.VersionType + "]");
Console.WriteLine("当前本地程序已是最新版本。");
Console.WriteLine("目前版本[" + string.Join(".", ProgramParameter.Version) + " - " + ProgramParameter.VersionType + "] 最新版本["+ ReleasesLatestInfo["tag_name"].ToString()+ "]");
}
}
}
Expand Down Expand Up @@ -432,9 +433,10 @@ static void Main(string[] args)
string[] DictionaryData;
try
{
string[] NewLine = new string[] { Environment.NewLine , "\r\n", "\n", "\r"};
using (StreamReader sr = new StreamReader(ProgramParameter.Dictionary, EncodingType.GetType(ProgramParameter.Dictionary)))
{
DictionaryData = sr.ReadToEnd().Split(new string[] { "\r\n" }, StringSplitOptions.None).Distinct().ToArray();
DictionaryData = sr.ReadToEnd().Split(NewLine, StringSplitOptions.RemoveEmptyEntries).Distinct().ToArray();
sr.Close();
}
}
Expand Down

0 comments on commit 1162572

Please sign in to comment.