-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
63 lines (61 loc) · 2.35 KB
/
Program.cs
File metadata and controls
63 lines (61 loc) · 2.35 KB
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
using iceping.Dependencies;
using iceping.utilities;
using System;
namespace iceping
{
class Program
{
static void Main(string[] args)
{
if( args[0] == "TCP" && args.Length < 3)
{
Console.WriteLine("Usage: iceping.exe <type> <host> <port> <protocol>");
Console.WriteLine("");
Console.WriteLine("<type>: Specify the method, \"HTTP\" could be for Web HTTP/HTTPS requests and the \"TCP\" for TCP connections.");
Console.WriteLine("<host>: You can use a hostname as example \"example.com\" or an ip address \"0.0.0.0\".");
Console.WriteLine("<port>: Use any integer between 1 to 65535.");
return;
}
else if (args[0] == "HTTP" && args.Length < 4)
{
Console.WriteLine("Usage: Icerequest.exe <type> <url> <method> <rps> <cps>");
Console.WriteLine("");
Console.WriteLine("<type>: Specify the method, \"HTTP\" could be for Web HTTP/HTTPS requests and the \"TCP\" for TCP connections.");
Console.WriteLine("<url>: The URL you want to target for your wicked request.");
Console.WriteLine("<method>: The HTTP method to use (e.g., GET, POST, DELETE).");
Console.WriteLine("<rps>: Number of requests per second (default: 1).");
Console.WriteLine("<cps>: Number of connections per second (default: 1).");
return;
}
switch (args[0])
{
case "HTTP":
WebPinger.PerformIceRequest(args);
break;
case "TCP":
Ping.Pinger(args);
break;
default:
break;
}
if (args[0] == "HTTP")
{
Console.CancelKeyPress += delegate
{
WebPinger.GetIcePercentages(args[1]);
Console.ResetColor();
return;
};
}
else if (args[0] == "TCP")
{
Console.CancelKeyPress += delegate
{
Ping.GetPercentages(args[1]);
Console.ResetColor();
return;
};
}
}
}
}