procedure NBGetMac(strings:Tstrings);
function HexBL(by:Byte):string;
begin
result:=format('%x',[by]);
if length(result)<2 then
result:='0'+result;
end;
var
NCB:TNCB;
Adapter:TAdapterStatus;
LanaEnum:TLanaEnum;
I,J:Integer;
Str:String;
begin
strings.clear;
ZeroMemory(@NCB,sizeof(NCB));
NCB.ncb_command:=chr(NCBENUM);
NetBios(@NCB);
NCB.ncb_buffer:=@LanaEnum;
NCB.ncb_length:=sizeof(lanaEnum);
NCB.ncb_command:=chr(NCBENUM);
NetBios(@NCB);
for i:=0 to ord(LanaEnum.length)-1do
begin
zeromemory(@NCB,sizeof(NCB));
NCB.ncb_command:=chr(NCBRESET);
NCB.ncb_lana_num:=lanaEnum.lana;
netbios(@NCB);
zeromemory(@NCB,sizeof(NCB));
NCB.ncb_command:=chr(NCBSTART);
NCB.ncb_Lana_num:=LanaEnum.lana;
strPcopy(NCB.ncb_callname,'*');
NCB.ncb_buffer:=@Adapter;
NCB.ncb_length:=sizeof(Adapter);
netbios(@NCB);
str:='';
for j:=0 to 5do
begin
if j>0 then
str:=str+'-';
str:str+HexBL(byte(adapter.adapter_address[j]));
end;
strings.add(str);
end;
end;