I would like to know the way to collect the IP of my PC and resolve and display

I would like delphi to grab my ISP IP and show and next to this resolve it to the hostname.
Could someone write a basic command to do this to add a nice feature to my program.

If you check this example URL you will see what I wish to display.

http://www.ipaddresslocation.org/

I am interested in showing what they call..

1.My IP Address (Public, External or WAN IP Address)
2.My IP Location (Guessed City)
3.Proxy Server Detection

I wish to be able to click "show details" and then show as above with no user interface.
Inter2001Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TheRealLokiSenior DeveloperCommented:
You could just screen scrape the HTML you get back from
http://www.tellmemyip.biz/
or whatismyip   lots of others
There's no other easy way to tget your "EXTERNAL" ip address, so you may as well use it and grab the hostname from it too....
no point doing the RDNS/whois etc yourself
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
senadCommented:
Try :
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs,WinSock, StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
   Timer1: TTimer;
   Label1: TLabel;
   function LocalIP: string; //<--insert this line
    procedure FormCreate(Sender: TObject);
   procedure Timer1Timer(Sender: TObject);
    procedure FormResize(Sender: TObject);
 private
   { Private declarations }
 public
   { Public declarations }
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
function TForm1.LocalIP: string;
type
  TaPInAddr = array [0..10] of PInAddr;
  PaPInAddr = ^TaPInAddr;
var
   phe: PHostEnt;
   pptr: PaPInAddr;
   Buffer: array [0..63] of char;
   i: Integer;
   GInitData: TWSADATA;
begin
   WSAStartup($101, GInitData);
   Result := '';
   GetHostName(Buffer, SizeOf(Buffer));
   phe :=GetHostByName(buffer);
   if phe = nil then Exit;
   pptr := PaPInAddr(Phe^.h_addr_list);
   i := 0;
   while pptr^[i] <> nil do
   begin
     result:=StrPas(inet_ntoa(pptr^[i]^));
     Inc(i);
   end;
   WSACleanup;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
  Label1.Caption:=LocalIP;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  Label1.Caption:=LocalIP;
end;

procedure TForm1.FormResize(Sender: TObject);
begin
Application.Title := Label1.Caption;

end;

end.

Open in new window

0
Geert GOracle dbaCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.