Cara Mendapatkan IP Address Komputer Dengan Delphi

Share On :
Ini Dia Tutorial Delphi tentang Cara Mendapatkan IP Address Komputer Dengan Delphi Mungkin bagi temen2 yang butuh untuk ngecek IP Addres komputer pakai aplikasi Delphi bisa nyoba cara berikut ini :
uses Winsock;
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;

Lalu
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(GetIps.text);
end;

0 komentar:

Post a Comment

  • Mahasiswa STMIK Duta Bangsa
  • description
  • description
  • description
  • description
  • description
  • description
  • description

Free Hosting

Free Hosting

My Blog List

A
B
C
     
D
E
F
DuGMp3    
G
H
I
Goo Otomotif HouseofScript  
J
K
L
Java Hotline    
M
N
O

My Games Collection

MeLangKah LeBih MaJu

   
P
Q
R
Pamella Decoration    
S
T
U
Studied WaLL    
V
W
X
     
Y
Z
0-9
     









Join....!


Free Domain

Free Domain

SiNyO. Powered by Blogger.