zoukankan      html  css  js  c++  java
  • /获取计算机Mac地址函数

    //获取计算机Mac地址函数

    function TFrm_Login.GetMacAddress: string;
    var
       Lib: Cardinal;
       Func: function(GUID: PGUID): Longint; stdcall;
       GUID1, GUID2: TGUID;
    begin
       Result := '';
       Lib := LoadLibrary('rpcrt4.dll');
       if Lib <> 0 then
       begin
         if Win32Platform <>VER_PLATFORM_WIN32_NT then
           @Func := GetProcAddress(Lib, 'UuidCreate')
           else @Func := GetProcAddress(Lib, 'UuidCreateSequential');
         if Assigned(Func) then
         begin
           if (Func(@GUID1) = 0) and
             (Func(@GUID2) = 0) and
             (GUID1.D4[2] = GUID2.D4[2]) and
             (GUID1.D4[3] = GUID2.D4[3]) and
             (GUID1.D4[4] = GUID2.D4[4]) and
             (GUID1.D4[5] = GUID2.D4[5]) and
             (GUID1.D4[6] = GUID2.D4[6]) and
             (GUID1.D4[7] = GUID2.D4[7]) then
           begin
             Result :=
              IntToHex(GUID1.D4[2], 2) +'-'+
              IntToHex(GUID1.D4[3], 2) +'-'+
              IntToHex(GUID1.D4[4], 2) +'-'+
              IntToHex(GUID1.D4[5], 2) +'-'+
              IntToHex(GUID1.D4[6], 2) +'-'+
              IntToHex(GUID1.D4[7], 2);
           end;
         end;
         FreeLibrary(Lib);
       end;
    end;

  • 相关阅读:
    IOS开发之——绘图(CGContext)
    网站相关人员信息记录humans.txt
    统一代码风格工具——editorConfig
    Bootstrap自动定位浮标
    Bootstrap图片轮播
    Bootstrap手风琴效果
    Bootstrap按钮插件
    Bootstrap弹出框
    Bootstrap提示框
    Bootstrap选项卡
  • 原文地址:https://www.cnblogs.com/lantianhf/p/5069529.html
Copyright © 2011-2022 走看看