⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 umain.~pas

📁 Delphi源码:获取计算机系统的逻辑硬盘号、物理硬盘号、Cpu号、Bios号等等。
💻 ~PAS
字号:
unit uMain;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,winsock,Nb30;

type
  TForm1 = class(TForm)
    GroupBox1: TGroupBox;
    GroupBox2: TGroupBox;
    rbDiskLogic: TRadioButton;
    rbDiskPhysical: TRadioButton;
    rbNicMac: TRadioButton;
    btnGet: TButton;
    Memo1: TMemo;
    rbBios: TRadioButton;
    rbCpu: TRadioButton;
    rbWinVersion: TRadioButton;
    procedure btnGetClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation
uses VersionID,GetDSN;
{$R *.dfm}

procedure TForm1.btnGetClick(Sender: TObject);
   procedure FillInfor(AsDesc:string);
   begin
         memo1.Lines.Add(AsDesc) ;
   end ;
var
   strTmp:string ;

   mac:TMACAddress ;
   RetCode: Byte;
   LanaNum: Byte;
begin
   if rbDiskLogic.Checked then
   begin
      strTmp := Trim(GetHDserial());
      if strTmp<>'' then
          FillInfor(rbDiskLogic.Caption +':'+strTmp)
      else
          FillInfor('获取硬盘逻辑特征码失败') ;
   end ;
   if rbDiskPhysical.Checked then
   begin
      strTmp := Trim(GetIdeDiskSerialNumber());
      if strTmp<>'' then
          FillInfor(rbDiskPhysical.Caption +':'+strTmp)
      else
          FillInfor('获取硬盘物理特征码失败') ;
   end ;

   if rbNicMac.Checked then
   begin
        //LanaNum:=0 ;
        //RetCode := ResetLana(LanaNum, 0, 0, lrAlloc);
        strTmp:=nbgetmac();
        //if RetCode <> NRC_GOODRET then
        if strTmp='' then
        begin
          FillInfor('获取网卡特征码失败') ;
        end else
        begin
            //RetCode:=GetMACAddress(0,@mac );
            //if RetCode <> NRC_GOODRET then
            //if strTmp='' then
            //begin
            //    FillInfor('获取网卡特征码失败') ;
            //end else
            //begin
                //strTmp:=Format('%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x',
                //[mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]]);
                FillInfor(rbNicMac.Caption +':'+strTmp);
            //end ;
       end ;

   end ;

   if rbBios.Checked  then
   begin
       //FillInfor(rbNicMac.Caption +':'+GetBios(1)); //BiosInfo
       FillInfor(BiosInfo);
       //FillInfor(GetBiosInfoAsText);
       //FillInfor(String(PChar(Ptr($FEC71))));

   end ;
   if rbCpu.Checked then
   begin
       FillInfor(kbGetCpuID());
   end ;
   if rbWinVersion.Checked then
   begin
       FillInfor('为0表示为win3x系统; 为1表示为win9x系统; 为2表示为winNT;  为3表示为win2000系统;为4表示为其他操作系统 :' + inttostr(WinVersion())) ;
   end ;
end;


end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -