-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
72 lines (64 loc) · 2.02 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Formatter
{
class Program
{
static void Main(string[] args)
{
// get all current threats
var items = System.IO.File.ReadAllLines("Threats.txt");
var rando = new Random();
// iterate threats
foreach(var item in items)
{
// do top pranking
WriteLine(item + " found");
WriteLine("Scanning " + item, ConsoleColor.Yellow);
WriteLine("Threat found in " + item, ConsoleColor.Red);
WriteLine("Removing " + item + " please wait. Do not turn off your computer - risk of hardware malfunction", ConsoleColor.Red);
for(var i = 0; i < 100; i++)
{
System.Threading.Thread.Sleep(rando.Next(500,7000));
ProgressBar(i);
}
Console.WriteLine();
}
}
/// <summary>
/// prankress bar
/// </summary>
/// <param name="progressPercent">percentage of current prank complete</param>
static void ProgressBar(int progressPercent)
{
for(var i = 0; i < 50; i++)
{
if(progressPercent/2 >= i)
{
Console.Write("█");
}
else
{
Console.Write("░");
}
}
if(progressPercent < 100)
{
Console.CursorLeft = 0;
}
}
/// <summary>
/// Write top pranks
/// </summary>
/// <param name="message">top prank</param>
/// <param name="color">color of prank</param>
static void WriteLine(string message, ConsoleColor color = ConsoleColor.Gray)
{
Console.ForegroundColor = color;
Console.WriteLine(message);
}
}
}