发信人: fangwd@GZ()
整理人: teleme(2001-03-31 01:03:59), 站内信件
|
标 题: Re: 请教:delphi下如何读取网卡的六字节地址(内空) 发信站: 网易虚拟社区 (Tue Jul 11 15:45:33 2000), 站内信件
【 在 cbb (百里丹波) 的大作中提到: 】
var
LanaNum: Byte;
MACAddress: PMACAddress;
RetCode: Byte;
begin
LanaNum := StrToInt(ComboBox1.Text);
New(MACAddress);
try
RetCode := GetMACAddress(LanaNum, MACAddress);
if RetCode = NRC_GOODRET then
begin
Edit1.Text := Format('%2.2x-%2.2x-%2.2x-%2.2x-%2.2x-%2.2x',
[MACAddress[0], MACAddress[1], MACAddress[2],
MACAddress[3], MACAddress[4], MACAddress[5]]);
end else
begin
Beep;
Edit1.Text := 'Error';
ShowMessage('GetMACAddress Error! RetCode = $' + IntToHex(RetCod e, 2));
end;
finally
Dispose(MACAddress);
end;
-- ※ 来源:.月光软件站 http://www.moon-soft.com.[FROM: 202.105.66.16]
|
|