//处理器类型
case SysInfo.dwProcessorType of
386:Edit6.Text:='386系列';
486:Edit6.Text:='486系列';
586:Edit6.Text:='奔腾系列';
4000:Edit6.Text:='MIPS_R4000';
21064:Edit6.Text:='ALPHA_21064';
end;
// 获取内存信息
var MemInfo: MEMORYSTATUS;
begin
GlobalMemoryStatus(MemInfo);
Memo1.Lines.Add(IntToStr(MemInfo.dwMemoryLoad) + '%的内存在使用');
Memo1.Lines.Add('物理内存共有' + IntToStr(MemInfo.dwTotalPhys) + '字节');
Memo1.Lines.Add('未使用的物理内存有' + IntToStr(MemInfo.dwAvailPhys) + '字节');
Memo1.Lines.Add('交换文件的大小为' + IntToStr(MemInfo.dwTotalPageFile) + '字节');
Memo1.Lines.Add('未使用的交换文件大小为' + IntToStr(MemInfo.dwAvailPageFile) + '字节');
Memo1.Lines.Add('虚拟内存空间大小为' + IntToStr(MemInfo.dwTotalVirtual) + '字节');
Memo1.Lines.Add('未使用的虚拟内存大小为' + IntToStr(MemInfo.dwAvailVirtual) + '字节');
end;
//获取系统和显卡的BIOS信息
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Panel1: TPanel;
Memo1: TMemo;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
ValueBuf: array[0..1000] of char;
implementation
{$R *.DFM}
procedure ParseValueBuf(const VersionType: string);
var
I: Cardinal;
S: string;
begin
i := 0;
while ValueBuf <> #0 do
begin
S := StrPas(@ValueBuf);
form1.memo1.Lines.Append(Format('%s=%s',[VersionType,S]));
//将信息显示在Memo1中
inc(i, Length(S) + 1);
end;
end;
procedure getBiosInfo;
const
Subkey: string = 'Hardware/description/system';
var
hkSB: HKEY;
rType: LongInt;
ValueSize, OrigSize: Longint;
begin
if RegOpenKeyEx(HKEY_LOCAL_MACHINE, PChar(Subkey), 0,
KEY_READ, hkSB) = ERROR_SUCCESS then
//打开HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System键,权限为读,//结果句柄保存在hkSB中
try
OrigSize := sizeof(ValueBuf);
ValueSize := OrigSize;
rType := REG_MULTI_SZ;
//键值类型为REG_MULTI_SZ
if RegQueryValueEx(hkSB, 'SystemBiosVersion', nil, @rType,
@ValueBuf, @ValueSize) = ERROR_SUCCESS then
ParseValueBuf('System BIOS Version');
//获取HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System/SystemBios Version键数据,得到系统BIOS版本信息。
ValueSize := OrigSize;
rType := REG_SZ;
//键值类型为REG _SZ
if RegQueryValueEx(hkSB, 'SystemBIOSDate', nil, @rType,
@ValueBuf, @ValueSize) = ERROR_SUCCESS then
form1.Memo1.Lines.Append('System BIOS Date ' + ValueBuf);
//获取HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System/ SystemBIOS Date键数据,得到系统BIOS出厂日期信息。
ValueSize := OrigSize;
rType := REG_MULTI_SZ;
if RegQueryValueEx(hkSB, 'VideoBiosVersion', nil, @rType,
@ValueBuf, @ValueSize) = ERROR_SUCCESS then
ParseValueBuf('Video BIOS Version');
//获取HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System/ VideoBios Version键数据,得到显卡BIOS版本信息。
ValueSize := OrigSize;
rType := REG_SZ;
if RegQueryValueEx(hkSB, 'VideoBIOSDate', nil, @rType,
@ValueBuf, @ValueSize) = ERROR_SUCCESS then
form1.Memo1.Lines.Append('Video BIOS Date ' + ValueBuf);
//获取HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System/ VideoBIOS Date键数据,得到显卡BIOS出厂日期信息。
finally
RegCloseKey(hkSB);
//关闭打开的键,无论前面是否发生异常
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
getBiosInfo;
end;
end.