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
| Ip1 := TStringList.Create;
Ip2 := TstringList.Create;
network.Split('.', edit1.text, Ip1) ;
network.Split('.', edit2.text, Ip2) ;
A:=StrToInt(Ip1[0]);
B:=StrToInt(Ip1[1]);
C:=StrToInt(Ip1[2]);
D:=StrToInt(Ip1[3]);
E:=StrToInt(Ip2[0]);
F:=StrToInt(Ip2[1]);
G:=StrToInt(Ip2[2]);
H:=StrToInt(Ip2[3]);
//CLASSE A
if (A in [1..126] ) then
if (A<>E) or(D>H)or (B>F) or (C>G) then
MessageDlg('Verifiez les adresses saisies', mtInformation, [mbOK], 0)
else
for i:=B to F do
for j:=C to G do
for k:=D to H do
begin
if stop=true then break;
if network.Ping(IntToStr(A)+'.'+IntToStr(i)+'.'+IntToStr(j)+'.'+InttoStr(k), 4, RoundTripTime) then
begin
memo1.Lines.add(IntToStr(A)+'.'+IntToStr(i)+'.'+IntToStr(j)+'.'+InttoStr(k)+' '+GStack.WSGetHostByAddr(IntToStr(A)+'.'+IntToStr(B)+'.'+IntToStr(C)+'.'+InttoStr(k))+' '+Format('%s',[FormatFloat('0.00',RoundTripTime)]));
end
else BEGIN
memo1.Lines.add(IntToStr(A)+'.'+IntToStr(i)+'.'+IntToStr(j)+'.'+InttoStr(k)+' '+'N/A'+' '+'N/A');
end; END; |
Partager