On Sat, Nov 7, 2015 at 12:13 PM, fecske fecske <[email protected]> wrote:

> or see  this
>
> http://forum.lazarus.freepascal.org/index.php/topic,17506.msg110917.html#msg110917


If you just want to get your external IP using some service like dyndns,
you should use pure FCL:

=== begin code ===

uses fphttpclient, RegExpr;

procedure TForm1.Button1Click(Sender: TObject);
begin
  with TRegExpr.Create('[0-9.]+') do try
    if Exec(TFPHTTPClient.SimpleGet('http://checkip.dyndns.org')) then
      ShowMessage(Match[0])
  finally Free; end;
end;

=== end code ==

However, if you can use other service like echoip.com, just:

=== begin code ===

uses  fphttpclient;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ShowMessage(TFPHTTPClient.SimpleGet('http://echoip.com/'));
end;

=== end code ===

HTH

-- 
Silvio Clécio
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to