- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
using System;
namespace IPGuard
{
class Program
{
public static void Main(string[] args)
{
System.Net.IPAddress IPAdress = null;
System.Net.NetworkInformation.Ping Ping = null;
for (int IP1 = 1; IP1 < 255; IP1++)
{
for (int IP2 = 0; IP2 < 255; IP2++)
{
for (int IP3 = 0; IP3 < 255; IP3++)
{
for (int IP4 = 0; IP4 < 255; IP4++)
{
IPAdress = System.Net.IPAddress.Parse(Convert.ToString(IP1) + "." + Convert.ToString(IP2) + "." + Convert.ToString(IP3) + "." + Convert.ToString(IP4));
Ping = new System.Net.NetworkInformation.Ping();
if (Ping.Send(IPAdress).Status == System.Net.NetworkInformation.IPStatus.Success)
{
Console.WriteLine(IPAdress);
}
}
}
}
}
}
}
}
четырьмя вложенными циклами?