Visit our Sponsor   Visit our Sponsor
delphi3000.com - the free delphi knowledge platform
delphi3000.com - the free delphi knowledge platform
500 Users Online NOW
Have a look at your member-status

connecting people's knowledge


  - Recent ArticlesRSS feed for Recent Articles on delphi3000.com
  - List of All Articles
  - Top Viewed Articles
  - Articles (+Attachem.)
  - Articles Of Interest
  - Categories
  - Top Uploader
  - Search
  - Index

  - My Home
  - Submit an Article
  - My Articles
  - My Personal Data
  - My Bookmarks
  - Activities
  - Login/Logout

  - Sign Up
  - Why Sign Up
  - Newsletter

  - Press
  - Advertise

  - Contact
  - Feedback





Community
Borland
ClubeDelphi
Dr. Bob
UK-BUG
Delphi Meetings
Planeta Delphi



Loremo - the 1.5 liter car coming in 2009




Startblatt.de






Share this article with friendsShare this article with friends
Rate this articleRate this article - to keep the quality of delphi3000.com !
Comment this article or read through previous comments (1)


The Fast and Best way to get a local IP AddressFormat this article printer-friendly!Bookmark function is only available for registered users!
" A maneira melhor e mais fácil de obter um endereço IP local"
Product:
Delphi all versions
Category:
Internet / Web
Skill Level:
Scoring:
Last Update:
06/08/2002
Search Keys:
delphi delphi3000 article borland vcl code-snippet IP ADDRESS LOCALHOST NET
Times Scored:
3
Visits:
5771
Uploader: Gerson Tomas
Company: META
Reference: N/A
 
Question/Problem/Abstract:
How get the local IP Address easy and fast?
"Como obter o endereço ip local de maneira rápida e fácil?"

Answer:




See:
"Veja:"
------------------------------------------------------------------

  function getIPs: Tstrings;
  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 := TstringList.Create;
    Result.Clear;
    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.Add(inet_ntoa(pptr^[I]^));
      Inc(I);
    end;
    WSACleanup;
  end;
------------------------------------------------------------------

This function not requires special units or triks to make your work
"Esta função não requer nada em especial para fazer seu trabalho"
:-)

Gérson, from Brazil.
"Gérson, do Brasil"






Please rate this article!
Skill level:
BeginnerExpert

Useful:
No!Very!

Overall rating:
PoorExcellent



Comments to this article
Write a new comment
Notes
    Ivo Christian Carvalho (Jun 10 2002 12:50PM)

Don't forget:

uses
  Winsock;
Respond














 
Sign up to consume product discounts for Bronze memberships !

read more


  Visit our Sponsor

 

  Community Ad of
S. Kucherov
 
   














 







     
  Copyright © 2000 - 2007 delphi3000.com - All rights reserved. Terms of use. || Privacy
delphi3000.com is a service by bluestep.com IT-Services GmbH (Vienna)