1.delphiè·åMACå°å代ç
delphiè·åMACå°å代ç
å¯ä»¥ç¨ä»¥ä¸å½æ°:
uses NB;
function GetMACAdress: string; //uses NB;
var
NCB: PNCB;
Adapter: PAdapterStatus;
URetCode: PChar;
RetCode: char;
I: integer;
Lenum: PlanaEnum;
_SystemID: string;
TMPSTR: string;
begin
Result := '';
_SystemID := '';
Getmem(NCB,源码php更换源码 SizeOf(TNCB));
Fillchar(NCB^, SizeOf(TNCB), 0);
Getmem(Lenum, SizeOf(TLanaEnum));
Fillchar(Lenum^, SizeOf(TLanaEnum), 0);
Getmem(Adapter, SizeOf(TAdapterStatus));
Fillchar(Adapter^, SizeOf(TAdapterStatus), 0);
Lenum.Length := chr(0);
NCB.ncb_command := chr(NCBENUM);
NCB.ncb_buffer := Pointer(Lenum);
NCB.ncb_length := SizeOf(Lenum);
RetCode := Netbios(NCB);
i := 0;
repeat
Fillchar(NCB^, SizeOf(TNCB), 0);
Ncb.ncb_command := chr(NCBRESET);
Ncb.ncb_lana_num := lenum.lana[I];
RetCode := Netbios(Ncb);
Fillchar(NCB^, SizeOf(TNCB), 0);
Ncb.ncb_command := chr(NCBASTAT);
Ncb.ncb_lana_num := lenum.lana[I];
// Must be
Ncb.ncb_callname := ('*');
Ncb.ncb_buffer := Pointer(Adapter);
Ncb.ncb_length := SizeOf(TAdapterStatus);
RetCode := Netbios(Ncb);
//---- calc _systemId from mac-address[2-5] XOR mac-address[1]...
if (RetCode = chr(0)) or (RetCode = chr(6)) then
begin
_SystemId := IntToHex(Ord(Adapter.adapter_address[0]), 2) + '-' +
IntToHex(Ord(Adapter.adapter_address[1]), 2) + '-' +
IntToHex(Ord(Adapter.adapter_address[2]), 2) + '-' +
IntToHex(Ord(Adapter.adapter_address[3]), 2) + '-' +
IntToHex(Ord(Adapter.adapter_address[4]), 2) + '-' +
IntToHex(Ord(Adapter.adapter_address[5]), 2);
end;
Inc(i);
until (I >= Ord(Lenum.Length)) or (_SystemID <> '-----');
FreeMem(NCB);
FreeMem(Adapter);
FreeMem(Lenum);
GetMacAdress := _SystemID;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
wxymac : String;
begin
wxymac:=GetMACAdress;
end;
2025-01-18 16:572046人浏览
2025-01-18 16:341589人浏览
2025-01-18 16:04766人浏览
2025-01-18 15:162974人浏览
2025-01-18 14:54923人浏览
2025-01-18 14:50902人浏览
中国消费者报杭州讯记者施本允)近日,位于浙江省杭州市拱墅区的国大城市广场放心消费商圈标准化试点项目顺利通过杭州市标准化试点项目评估验收,成为杭州市消费领域唯一获评项目,也是拱墅区深耕“放心消费在浙江”
1.javaweb与php的差别(javaweb和php区别)2.sidekick手机铃声skin手机铃声3.JAVAåPHPçåºå«4.Linux的创始人是谁?5.java和php哪个
1.base64_decode 解å¯2.一眼就能记住的店名1330个3.吞食天地金手指用法4.建一个网站大概需要多少钱?base64_decode è§£å¯ æ èåï¼è