Article View: borland.public.cppbuilder.internet.socket
Article #1812Re. How to check my IP
From: Elmar Baumann
Date: Mon, 30 Oct 2006 19:49
Date: Mon, 30 Oct 2006 19:49
54 lines
2168 bytes
2168 bytes
>Marcin_g wrote in Article <4543afc2$1@newsgroups.borland.com>
>with Subject: How to check my IP, on 28.10.2006 20:30:10
>
>
>
>Hi,
>I write simple server (ServerSocket component in BCB6.0) application and I would like to check my IP address and/or internet connection accesibility. How to make this?
>Please help.
hello,
i've wrote a small indy9-app (BCB6) for that:
download at http://home.arcor.de/elmar-baumann/tools/wanip.exe
it gets the IP via HTTP-Request on http://checkip.dyndns.org !
void __fastcall TForm1::GetIP() //called by OnButtonClick
{
int a,b;
AnsiString line;
try
{
line = IdHTTP1->Get("http://checkip.dyndns.org");
}
catch (Exception &exception)
{
MessageBox(0,exception.Message.c_str(),"Connection Error",MB_OK);
}
a = line.Pos("Current IP Address:");
b = line.Pos("</body>");
IP = line.SubString(a+19,b-(a+19));
Edit1->Text = IP;
}
Regards
Elmar Baumann
------------------------------------------------------------------------------
Indy9 NNTP Internet News Reader/Writer, E. Baumann Software 2005
�Online on IRC, irc.p2p-network.net, #CodersPlanet�
Portions of this Software are Copyright (c) 1993 - 2005,
Chad Z. Hower (Kudzu) and the Indy Pit Crew
<http://www.IndyProject.org/>
Technical Details
Message-ID:
<4546576a@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4543afc2$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,5680ee52ab0838a6 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII From: "Elmar Baumann" <elmar-nospam@anywhere.net> Subject: Re. How to check my IP Newsgroups: borland.public.cppbuilder.internet.socket Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Organization: Baumann Software NNTP References: <4543afc2$1@newsgroups.borland.com> Date: Mon, 30 Oct 2006 20:49:58 +0100 X-Newsreader: BaumannSoftware NNTP NNTP-Posting-Host: 84.62.184.20 Message-ID: <4546576a@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1162237802 84.62.184.20 (30 Oct 2006 11:50:02 -0700) Lines: 55 Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail