您现在的位置: 华盟网 >> 编程 >> Delphi >> 正文

Delphi下读取网卡的MAC

2008/4/20 作者:不详 来源: 华夏收集
导读 var  LanaNum: Byte;  MACAddress: PMACAddress;  RetCode: Byte; begin  LanaNum := …
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-%.2x', MACAddress[0], MACAddress[1], MACAddress[2], MACAddress[3], MACAddress[4], MACAddress[5]]);
    end else
    begin
      Beep;
      Edit1.Text := 'Error';
      ShowMessage('GetMACAddress Error! RetCode
                  微信群名称:华盟黑白之道二群   华盟-黑白之道⑦QQ群: 9430885

  • 上一篇编程:

  • 下一篇编程:
  • 网友评论
      验证码
     

    关注

    分享

    0

    讨论

    2

    猜你喜欢

    论坛最新贴