Link to home
Start Free TrialLog in
Avatar of mmilan
mmilan

asked on

My IP

How can I read my IP address from Delphi application? Please send me source code. Thakn's
ASKER CERTIFIED SOLUTION
Avatar of inthe
inthe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of inthe
inthe

btw ,
if you have wsocket of f.piette and are on a network you can do this:

var
    IPList : TStrings;
    I      : Integer;
begin
    IPList := WSocket1.LocalIPList;
     for I := 0 to IPList.Count - 1 do
     Memo1.Lines.Add(IPList.Strings[I]);
end;

to get all ip addresses.
This code works if the machine is Win9x with DNS disabled?
Idem to DNS enabled and HostName invalid?

To Radler
hi ya
>>This code works if the machine is Win9x with DNS >>disabled?

which code do you mean?
the answer code or the f.piette code.?
did you get a error ?
i never tried with dns disabled,how you do that?
i used several times,several pc's with no troubles
.
hostname invalid?
where did this appear ?
in the editbox?
Regards
Yes, with f.piete I received a invalid hostname.
procedure TForm1.Button2Click(Sender: TObject);
var
    IPList : TStrings;
    I      : Integer;
begin
    IPList := WSocket.LocalIPList;
     for I := 0 to IPList.Count - 1 do
     Memo1.Lines.Add(IPList.Strings[I]);
end;

works with no problem for me.
are you sure it is using the wsocket of f.piette of another wsocket/
i have 3 wsocket.pas files  with different components and all are different files /sizes diffferent etc.

the best place to ask about this error is on francois's web site where he has a support mailing list and will help you with the problem.,he will be able to give the answer straight away im sure.

http://www.rtfm.be/fpiette/supportuk.htm
Revised the situation
I found that DNS is enabled, but HostName and/or Domain are/is blank(s)
thanks by your attention.