Registriert seit: 4. Feb 2003
Ort: Hannover
2.032 Beiträge
Delphi 12 Athens
|
AW: Internet IP herausfinden
24. Sep 2011, 19:22
Delphi-Quellcode:
Function TForm1.GeExtIP: string;
var ndx: integer;
begin
result:=uppercase(Http1.Get('http:\\www.network-tools.com'));
if result='' then result:='GET failed' else
begin
ndx:=pos('HOST',result);
if ndx=0 then result:='host not found' else
begin
delete(result,1,ndx+4);
ndx:=pos('VALUE=',result);
if ndx>0 then delete(result,1,ndx+6);
ndx:=pos('"',result);
if ndx>0 then result:=copy(result,1,ndx);
end;
end;
end;
Externe- IP sieht man schlicht von extern, also muß man extern fragen.
Martin Schaefer
|
|
Zitat
|