Get computer MAC address


/ Published in: Delphi
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.