-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
107 lines (85 loc) · 2.98 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
using System.Net.Mail;
using System.Net.Mime;
namespace theuselesscmd;
class Program
{
static void Main()
{
Console.WriteLine("welcome to theuselesscmd!");
// Password validation if password is set
if (Commands.IsPasswordProtected)
{
Console.Write("enter password to continue: ");
string? inputPassword = Console.ReadLine();
if (inputPassword != null && !Commands.ValidatePassword(inputPassword))
{
Console.WriteLine("incorrect password! access denied.");
Environment.Exit(1);
}
Console.WriteLine("access granted.");
}
else
{
Console.WriteLine("no password set. Use 'pass set' to set one.");
}
Console.WriteLine("type 'idk' for a list of commands."); // not a command, but it still triggers Commands.UnknownCommand
while (true)
{
// Main command loop
Console.Write($"\n{System.Environment.UserName}@{System.Environment.MachineName} $ ");
string command = Console.ReadLine();
switch (command)
{
case "ip":
Commands.IpAddress();
break;
case "datetime":
Commands.GetDateTime();
break;
case "magic8ball":
Commands.Magic8Ball();
break;
case "shutup":
Commands.ShutUp();
break;
case "pass set":
Commands.SetPassword();
break;
case "pass rm":
Commands.RemovePassword();
break;
case "pass":
Commands.PassNoParam();
break;
case "dice":
Commands.RollDice();
break;
case "sd":
Commands.SelfDestruct();
break;
case "fortune":
Commands.Fortune();
break;
case "tellajoke":
Commands.TellAJoke();
break;
case "lag":
Commands.Lag();
break;
case "facts":
Commands.UselessFact();
break;
case "unicode":
Commands.PrintUnicodeChar();
break;
case "exit":
Console.WriteLine("goodbye!");
Environment.Exit(0);
break;
default:
Commands.UnknownCommand();
break;
}
}
}
}