Добавить SubnetScanner/ScanSubnet.cs
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
namespace IP_port_checker.SubnetScanner
|
||||
{
|
||||
public class SubnetScanner
|
||||
{
|
||||
public static void ScanSubnet()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
string ip = "";
|
||||
int mask = 0;
|
||||
|
||||
string cidr = SubnetValid.SubValid("Введите подсеть: ", ref ip, ref mask);
|
||||
|
||||
string[] parts = ip.Split('.');
|
||||
string network = $"{parts[0]}.{parts[1]}.{parts[2]}";
|
||||
|
||||
IsHostAlive.ParralelScan(network);
|
||||
|
||||
Console.WriteLine("Готово! Повторить еще раз? Y/N");
|
||||
|
||||
string? input = Console.ReadLine()?.ToLower() ?? "n";
|
||||
bool exit = input?.ToLower() switch
|
||||
{
|
||||
"y" => false,
|
||||
"n" => true,
|
||||
_ => true
|
||||
};
|
||||
|
||||
if (exit) break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user