D
deardragon_2002
Unregistered / Unconfirmed
GUEST, unregistred user!
type
TaPInAddr = array [0..10] of PInAddr;
PaPInAddr = ^TaPInAddr;
var
phe : PHostEnt;
pptr : PaPInAddr;
Buffer : array [0..63] of char;
I : Integer;
GInitData : TWSADATA;
res_ip :string;
begin
WSAStartup($101, GInitData);
Res_ip := '';
GetHostName(Buffer, SizeOf(Buffer));
phe :=GetHostByName(buffer);
if phe = nil then
Exit;
pptr := PaPInAddr(Phe^.h_addr_list);
I := 0;
while pptr^ <> nildo
begin
res_ip:=StrPas(inet_ntoa(pptr^^));
Inc(I);
end;
WSACleanup;
end;
[red]我的mac是具体的16进制数,可能是多网卡的mac.哪位高手可以实现下面的函数
function GetIPFromMacAddress(AMacAddress: string): string;[/red]
TaPInAddr = array [0..10] of PInAddr;
PaPInAddr = ^TaPInAddr;
var
phe : PHostEnt;
pptr : PaPInAddr;
Buffer : array [0..63] of char;
I : Integer;
GInitData : TWSADATA;
res_ip :string;
begin
WSAStartup($101, GInitData);
Res_ip := '';
GetHostName(Buffer, SizeOf(Buffer));
phe :=GetHostByName(buffer);
if phe = nil then
Exit;
pptr := PaPInAddr(Phe^.h_addr_list);
I := 0;
while pptr^ <> nildo
begin
res_ip:=StrPas(inet_ntoa(pptr^^));
Inc(I);
end;
WSACleanup;
end;
[red]我的mac是具体的16进制数,可能是多网卡的mac.哪位高手可以实现下面的函数
function GetIPFromMacAddress(AMacAddress: string): string;[/red]