Skip to content

Commit cd4cd16

Browse files
committed
Optimize judgment logic to reduce system overhead;
rename the project; fix typos
1 parent e480f29 commit cd4cd16

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

ConsoleApp1.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
4-
VisualStudioVersion = 17.12.35527.113 d17.12
4+
VisualStudioVersion = 17.12.35527.113
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1.csproj", "{8763ED55-3918-48BC-839F-4A1B04705176}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Auto-Update-Checker", "Auto-Update-Checker.csproj", "{8763ED55-3918-48BC-839F-4A1B04705176}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution

Program.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -374,22 +374,21 @@ REM End of script
374374
}
375375

376376

377-
static string[] ParseArguments(string[] argv, string defaultUrl = null)
378-
{
379-
if defaultURL.Equals("input your defualt url here")
377+
static string[] ParseArguments(string[] argv, string defaultURL = null)
378+
{
379+
if (argv.Length == 0)
380380
{
381-
Console.WriteLine("Please input your default url in the code.");
381+
Console.WriteLine("No arguments provided. Please provide the required arguments.");
382382
return new string[] { "helpModel", null, null };
383383
}
384-
385-
Dictionary<string, string> argsDict = new Dictionary<string, string>();
386384

387-
if (argv.Length == 0)
385+
if (defaultURL.Equals("input your defualt url here"))
388386
{
389-
Console.WriteLine("No arguments provided. Please provide the required arguments.");
387+
Console.WriteLine("Attention, please input your default url in the code.");
390388
return new string[] { "helpModel", null, null };
391389
}
392390

391+
Dictionary<string, string> argsDict = new Dictionary<string, string>();
393392
for (int i = 0; i < argv.Length; i++)
394393
{
395394
if (argv[i].StartsWith("-") || argv[i].StartsWith("/"))
@@ -413,7 +412,7 @@ static string[] ParseArguments(string[] argv, string defaultUrl = null)
413412
}
414413

415414
// 设置默认值或获取用户提供的值
416-
string url = argsDict.ContainsKey("url") ? argsDict["url"] : defaultUrl;
415+
string url = argsDict.ContainsKey("url") ? argsDict["url"] : defaultURL;
417416
string version = argsDict.ContainsKey("version") ? argsDict["version"] : null;
418417
string showConfirm = argsDict.ContainsKey("showConfirm") && argsDict["showConfirm"]?.ToLower() == "false" ? "false" : "true";
419418

0 commit comments

Comments
 (0)