• Delphi 获取网卡地址


    //获取网卡MAC地址
    function 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;

  • 相关阅读:
    C#类型转换
    C#运算符
    SQL视图与触发器
    存储过程
    SQL 变量
    SQL 经典练习题
    字符串函数,数据类型转换,链接查询,纵向查询
    常用的 SQL 函数
    习题整理(1)
    子查询的部分内容
  • 原文地址:https://www.cnblogs.com/zhangzhifeng/p/2537645.html
Copyright © 2020-2023  润新知