function GetAdapterInfo:string;//(Lana: Char): String;
var
Adapter: TAdapterStatus;
NCB: TNCB;
begin
FillChar(NCB, SizeOf(NCB), 0);
NCB.ncb_command := Char(NCBRESET);
NCB.ncb_lana_num := #0;//Lana;
if Netbios(@NCB) <> Char(NRC_GOODRET) then
begin
Result := '';
Exit;
end;
FillChar(NCB, SizeOf(NCB), 0);
NCB.ncb_command := Char(NCBASTAT);
NCB.ncb_lana_num := #0;//Lana;
NCB.ncb_callname := '*';
FillChar(Adapter, SizeOf(Adapter), 0);
NCB.ncb_buffer := @Adapter;
NCB.ncb_length := SizeOf(Adapter);
if Netbios(@NCB) <> Char(NRC_GOODRET) then
begin
Result := '';
Exit;
end;
Result :=
IntToHex(Byte(Adapter.adapter_address[0]), 2) +
IntToHex(Byte(Adapter.adapter_address[1]), 2) +
IntToHex(Byte(Adapter.adapter_address[2]), 2) +
IntToHex(Byte(Adapter.adapter_address[3]), 2) +
IntToHex(Byte(Adapter.adapter_address[4]), 2) +
IntToHex(Byte(Adapter.adapter_address[5]), 2);
end;
只要装了netbios就行了
:)
包含头文件为nb30