精华区 [关闭][返回]

当前位置:网易精华区>>讨论区精华>>编程开发>>● Delphi>>Delphi 网络编程>>Re: 请教:delphi下如何读取网卡的六字节

主题:Re: 请教:delphi下如何读取网卡的六字节
发信人: fangwd()
整理人: (2000-12-05 18:39:45), 站内信件
【 在 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]

[关闭][返回]