DELPHI 获取网卡MAC 地址 1、通过 IP 取MAC 地址 uses WinSock; Function sendarp(ipaddr:ulong; temp:dword; ulmacaddr:pointer; ulmacaddrleng:pointer) : DWord; StdCall; External 'Iphlpapi
dll' Name 'SendARP'; procedure TForm1
Button1Click(Sender: TObject); var myip:ulong; mymac:array[0
5] of byte; mymaclength:ulong; r:integer; begin myip:=inet_addr(PChar('192
180')); mymaclength:=length(mymac); r:=sendarp(myip,0,@mymac,@mymaclength); label1
caption:='errorcode:'+inttostr(r); label2
caption:=format('%2
2x',[mymac[0],mymac[1],mymac[2],mymac[3],mymac[4],mymac[5]]); end; 2、取 MAC 地址 (含多网卡),最好的方法,支持 Vista,Win7 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, WinSock, StdCtrls