-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathProgram.cs
59 lines (55 loc) · 1.81 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System;
using System.Globalization;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static async Task Main(string[] args)
{
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
Console.OutputEncoding = Encoding.UTF8;
Console.InputEncoding = Encoding.Unicode;
try
{
bool flag = true;
while (flag)
{
try
{
Console.WriteLine("请输入保存目录,按q退出");
string cmd = Console.ReadLine();
if (cmd == "q")
{
Console.WriteLine("你确定要退出?(退出请输入y,否则,输入n。)");
var yesORno = Console.ReadKey().Key.ToString().ToUpper();
switch (yesORno)
{
case "Y":
flag = false;
break;
case "N":
flag = true;
break;
}
}
else
{
await BoosDownloaderService.ExecuteAsync(cmd);
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
}