根据标题 – 任何人都可以帮助我吗?
解决方法
从
Project JEDI API Header Library获取Microsoft IP Helper Library的JEDI转换 – 该文件是IPHlpAPI.zip.解压缩文件,需要IpTypes.pas和IpHlpApi.pas.然后你可以使用这样的东西:
procedure TForm1.Button1Click(Sender: TObject); var NumInterfaces: Cardinal; AdapterInfo: array of TIpAdapterInfo; OutBufLen: ULONG; i: integer; begin GetNumberOfInterfaces(NumInterfaces); SetLength(AdapterInfo,NumInterfaces); OutBufLen := NumInterfaces * SizeOf(TIpAdapterInfo); GetAdaptersInfo(@AdapterInfo[0],OutBufLen); Memo1.Lines.Clear; for i := 0 to NumInterfaces - 1 do begin Memo1.Lines.Add(Format('%.2x:%.2x:%.2x:%.2x:%.2x:%.2x',[AdapterInfo[i].Address[0],AdapterInfo[i].Address[1],AdapterInfo[i].Address[2],AdapterInfo[i].Address[3],AdapterInfo[i].Address[4],AdapterInfo[i].Address[5]])); end; end;