请知道的提示一下,谢谢

解决方案 »

  1.   

    procedure 2var ver:integer;//版本号   major:integer;//主版本号   minor:integer;//次版本号beginver:=getversion();//获得版本号major:=ver and 255;//获得主版本号minor:=(ver and 255*256)div 256; //获得次版本号showmessage(‘系统版本号是:’+inttostr(ver)); //显示版本号showmessage(‘系统主版本号是:'+inttostr(major));//显示主版本号showmessage(‘系统次版本号是:'+inttostr(minor));//显示次版本号end;
      

  2.   

    内存信息Structure of TMemoryStatus:  TMemoryStatus = record
        dwLength: DWORD;
        dwMemoryLoad: DWORD;
        dwTotalPhys: DWORD;
        dwAvailPhys: DWORD;
        dwTotalPageFile: DWORD;
        dwAvailPageFile: DWORD;
        dwTotalVirtual: DWORD;
        dwAvailVirtual: DWORD;Function called to populate TMemoryStatus:procedure GlobalMemoryStatus(var lpBuffer: TMemoryStatus); stdcall;WINAPI help for said function:  VOID GlobalMemoryStatus(
        // pointer to the memory status structure
        LPMEMORYSTATUS  lpBuffer  
      ); Code for populating a TMemo with Information about system resources:unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Button1: TButton;
        Memo1: TMemo;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
    var
      MemoryStatus: TMemoryStatus;begin  Memo1.Lines.Clear;  MemoryStatus.dwLength := SizeOf(MemoryStatus);  GlobalMemoryStatus(MemoryStatus);  with MemoryStatus do
      begin
    // Size of MemoryStatus record
        Memo1.Lines.Add(IntToStr(dwLength) +
          ' Size of ''MemoryStatus'' record');
    // Per-Cent of Memory in use by your system
        Memo1.Lines.Add(IntToStr(dwMemoryLoad) +
          '% memory in use');
    // The amount of Total Physical memory allocated to your system.
        Memo1.Lines.Add(IntToStr(dwTotalPhys) +
          ' Total Physical Memory in bytes');
    // The amount available of physical memory in your system.
        Memo1.Lines.Add(IntToStr(dwAvailPhys) +
          ' Available Physical Memory in bytes');
    // The amount of Total Bytes allocated to your page file.
        Memo1.Lines.Add(IntToStr(dwTotalPageFile) +
          ' Total Bytes of Paging File');
    // The amount of available bytes in your page file.
        Memo1.Lines.Add(IntToStr(dwAvailPageFile) +
          ' Available bytes in paging file');
    // The amount of Total bytes allocated to this program
    // (generally 2 gigabytes of virtual space).
        Memo1.Lines.Add(IntToStr(dwTotalVirtual) +
          ' User Bytes of Address space');
    // The amount of avalable bytes that is left to your program to use.
        Memo1.Lines.Add(IntToStr(dwAvailVirtual) +
          ' Available User bytes of address space');
      end; // with
    end; // procedureend.
      

  3.   

    function GetCpuSpeed: Extended;
    var
        t, mhi, mlo, nhi, nlo: dword;
        shr32 : comp;
    begin
        shr32 := 65536;
        shr32 := shr32 * 65536;
        t := GetTickCount;
        while t = GetTickCount do ;
        asm
            DB 0FH,031H // rdtsc
            mov mhi,edx
            mov mlo,eax
        end;
        while GetTickCount < (t + 1000) do ;
        asm
            DB 0FH,031H // rdtsc
            mov nhi,edx
            mov nlo,eax
        end;
        Result := ((nhi * shr32 + nlo) - (mhi * shr32 + mlo)) / 1E6;
    end;
    function GetWindowsVersion : string;
    var
      OsVinfo   : TOSVERSIONINFO;
      HelpStr   : array[0..50] of char;
    begin  
      ZeroMemory(@OsVinfo,sizeOf(OsVinfo));
      OsVinfo.dwOSVersionInfoSize := sizeof(TOSVERSIONINFO);  
      if GetVersionEx(OsVinfo) then
      begin  
        if OsVinfo.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS then
        begin
          if (OsVinfo.dwMajorVersion = 4) and
             (OsVinfo.dwMinorVersion > 0) then
            StrFmt(HelpStr, 'Windows 98 - Version %d.%.2d.%d',
                   [OsVinfo.dwMajorVersion, OsVinfo.dwMinorVersion,
                    OsVinfo.dwBuildNumber and $FFFF])
          else
            StrFmt(HelpStr, 'Windows 95 - Version %d.%d Build %d',
                   [OsVinfo.dwMajorVersion, OsVinfo.dwMinorVersion,
                    OsVinfo.dwBuildNumber and $FFFF]);
        end;
        if OsVinfo.dwPlatformId = VER_PLATFORM_WIN32_NT then
          StrFmt(HelpStr, 'Microsoft Windows NT Version %d.%.2d.%d',
                 [OsVinfo.dwMajorVersion, OsVinfo.dwMinorVersion,
                  OsVinfo.dwBuildNumber and $FFFF]);
      end
      else
        StrCopy(HelpStr, 'GetversionEx() Error');
      Result := string(HelpStr);  
    end;检测内存
    var memory:TMemoryStatus;
    begin
      memory.dwLength:=sizeof(memory);
      GlobalMemoryStatus(memory);
      label10.Caption:='共:'+inttostr(trunc(memory.dwTotalPhys/(1024)))+'K/可用:'
          +inttostr(trunc(memory.dwAvailPhys/(1024)))+'K';
      label5.Caption:=syscfg.Provider;
      label9.Caption:=inttostr(trunc(GetCpuSpeed));
      label12.Caption:=GetWindowsVersion;
      label14.Caption:=inttostr(screen.Width)+'*'+inttostr(screen.Height);
    end;
      

  4.   

    哪里有取系统信息的VCL组件?比如取CPU主频,内存及硬盘参数等