delphi非常好用的获得硬件ID。
uses u_MD5, Windows, ShellApi, Classes, SysUtils;
{$I u_Const.pas}
{$IFDEF NEWVER} //for Delphi2009 or higher
function GetDllVer:PAnsiChar; stdcall; export;
function GetHardwareID(HDD, NIC, CPU, BIOS: LongBool): PAnsiChar; stdcall; export;
function GetHardwareID_vba(HDD, NIC, CPU, BIOS: LongBool; RegCode: PAnsiChar; retHardwareID: PAnsiChar): Integer; stdcall; export;
function GetHardwareIDWithAppID(AppID: PAnsiChar; HDD, NIC, CPU, BIOS: LongBool): PAnsiChar; stdcall; export;
function GetHardwareIDWithAppID_vba(AppID: PAnsiChar; HDD, NIC, CPU, BIOS: LongBool; RegCode: PAnsiChar; retHardwareID: PAnsiChar): Integer; stdcall; export;
{$ELSE} //for delphi7/6/5
function GetDllVer:PChar; stdcall; export;
function GetHardwareID(HDD, NIC, CPU, BIOS: LongBool): PChar; stdcall; export;
function GetHardwareID_vba(HDD, NIC, CPU, BIOS: LongBool; RegCode: PChar; retHardwareID: PChar): Integer; stdcall; export;
function GetHardwareIDWithAppID(AppID: PChar; HDD, NIC, CPU, BIOS: LongBool): PChar; stdcall; export;
function GetHardwareIDWithAppID_vba(AppID: PChar; HDD, NIC, CPU, BIOS: LongBool; RegCode: PChar; retHardwareID: PChar): Integer; stdcall; export;
{$ENDIF}
1