Posted By

icebob on 08/02/10


Tagged

MAC-address


Versions (?)

Get computer MAC address


 / Published in: Delphi
 

  1. function GetMACAddress: string;
  2. var
  3. AdapterList: TLanaEnum;
  4. NCB: TNCB;
  5. begin
  6. FillChar(NCB, SizeOf(NCB), 0);
  7. NCB.ncb_command := Char(NCBENUM);
  8. NCB.ncb_buffer := @AdapterList;
  9. NCB.ncb_length := SizeOf(AdapterList);
  10. Netbios(@NCB);
  11. if Byte(AdapterList.length) > 0 then
  12. Result := GetAdapterInfo(AdapterList.lana[0])
  13. else
  14. Result := 'mac not found';
  15. end;

Report this snippet  

You need to login to post a comment.