Форум: "Начинающим";
Текущий архив: 2005.11.27;
Скачать: [xml.tar.bz2];
ВнизMAC address Найти похожие ветки
← →
lionmen © (2005-11-08 13:53) [0]Подскажите плиз, как программным путем взять данные сетевой карты, т е МАС адрес?
← →
Rentgen © (2005-11-08 14:13) [1]uses
NB30;
function GetAdapterInfo(Lana: Char): String;
var
Adapter: TAdapterStatus;
NCB: TNCB;
begin
FillChar(NCB, SizeOf(NCB), 0);
NCB.ncb_command := Char(NCBRESET);
NCB.ncb_lana_num := Lana;
if Netbios(@NCB) <> Char(NRC_GOODRET) then
begin
Result := "mac not found";
Exit;
end;
FillChar(NCB, SizeOf(NCB), 0);
NCB.ncb_command := Char(NCBASTAT);
NCB.ncb_lana_num := 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 := "mac not found";
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;
function GetMACAddress: string;
var
AdapterList: TLanaEnum;
NCB: TNCB;
begin
FillChar(NCB, SizeOf(NCB), 0);
NCB.ncb_command := Char(NCBENUM);
NCB.ncb_buffer := @AdapterList;
NCB.ncb_length := SizeOf(AdapterList);
Netbios(@NCB);
if Byte(AdapterList.length) > 0 then
Result := GetAdapterInfo(AdapterList.lana[0])
else
Result := "mac not found";
end;
//Взято с sources.ru
← →
lionmen © (2005-11-11 11:00) [2]Спасип Рентген!!! ))))
Страницы: 1 вся ветка
Форум: "Начинающим";
Текущий архив: 2005.11.27;
Скачать: [xml.tar.bz2];
Память: 0.44 MB
Время: 0.015 c