10-09-2009, 03:16 PM
يمكن كتابة الكود بشكل أفضل:
كما يمكن استخراج صورة علم البلد والخريطة وغير ذلك، أو استخدام مواقع أخرى تقدم معلومات أكثر مثل:
PHP كود :
function GetBetween(Str, FirstDemarc, SecondDemarc: String): String;
begin
Result := Trim(Copy(Str,
Pos(FirstDemarc,Str)+length(FirstDemarc),
Pos(SecondDemarc, Str)-Pos(FirstDemarc,Str)-length(FirstDemarc)));
end;
procedure TForm1.Button1Click(Sender: TObject);
Function Ip_Internet : String;
Var Acces_Web : TIdHttp;
Begin
Acces_Web := TIdHttp.Create(Nil);
Try
try
//or 'http://www.whatismyip.org' to get just IP net.
Result := Acces_Web.Get('http://www.ip-adress.com/');
except
MessageBox(Handle, 'Connection faild!','Error',MB_OK+MB_ICONERROR);
end;
Finally
Acces_Web.Free;
End;
End;
begin
Label1.Caption := GetBetween(Ip_Internet, 'ss: ', '</h2>');
Label3.Caption := GetBetween(Ip_Internet, 'g">', '<br>');
Label2.Caption := GetBetween(Ip_Internet, 'IP: ', '"content2');
Label2.Caption := Copy(Label2.Caption,0,length(Label2.Caption)-51);
end;
كود :
http://whatismyipaddress.com/
اللهم احقن دماء المسلمين، لا تنسوهم بالدعاء...

