热度 3||
一、声明
代码
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1 GetSystemInfo(
var lpSystemInfo: TSystemInfo {}
);
//TSystemInfo 是 _SYSTEM_INFO 结构的重定义:
_SYSTEM_INFO = record
case Integer of
0: (
dwOemId: DWORD); {返回计算机标识符, 已废弃}
1: (
wProcessorArchitecture: Word; {处理器的体系结构}
wReserved: Word; {保留}
dwPageSize: DWORD; {分页大小}
lpMinimumApplicationAddress: Pointer;{最小寻址空间}
lpMaximumApplicationAddress: Pointer;{最大寻址空间}
dwActiveProcessorMask: DWORD; {处理器掩码; 0..31 表示不同的处理器}
dwNumberOfProcessors: DWORD; {处理器数目}
dwProcessorType: DWORD; {处理器类型}
dwAllocationGranularity: DWORD; {虚拟内存空间的粒度}
wProcessorLevel: Word; {处理器等级}
wProcessorRevision: Word); {处理器版本}
end;
二、例子
例子
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1 unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls;
type
TForm1 = class(TForm)
btn1: TButton;
redt1: TRichEdit;
procedure btn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.btn1Click(Sender: TObject);
var
sys:TSystemInfo;
begin
GetSystemInfo(sys);
with redt1.Lines do
begin
Add(Format('处理器类型 (ProcessorType):' + #9#9 +'%d',[sys.dwProcessorType]));
Add(Format('OEMID: ' +#9#9#9#9#9 + '%d',[sys.dwOemId]));
Add(Format('处理器架构 (ProcessorArchitecture):' + #9#9 + '%d',[sys.wProcessorArchitecture]));
Add(Format('处理器数量 (NumberOfProcessors):'+ #9#9 + '%d',[sys.dwNumberOfProcessors]));
Add(Format('处理器版本 (ProcessorRevision):' + #9#9 + '%d',[sys.wProcessorRevision]));
Add(Format('分页大小 (PageSize):' + #9#9#9 + '%d',[Sys.dwPageSize]));
Add(Format('最小寻址空间 (MinimumApplicationAddress):' +#9 + '%d',[Integer(Sys.lpMinimumApplicationAddress)]));
Add(Format('最大寻址空间 (MaximumApplicationAddress):' +#9 + '%d',[Integer(Sys.lpMaximumApplicationAddress)]));
Add(Format('处理器掩码 (ActiveProcessorMask):' +#9#9 + '%d',[Integer(Sys.dwActiveProcessorMask)]));
Add(Format('处理器内存粒度 (AllocationGranularity):' +#9 + '%d',[Integer(Sys.dwAllocationGranularity)]));
Add(Format('处理器等级 (ProcessorLevel):' +#9#9 + '%d',[Integer(Sys.wProcessorLevel)]));
end;
end;
end.
|站长微信|Archiver|手机版|小黑屋|用友之家 ( 蜀ICP备07505338号|51072502110008 )
GMT+8, 2024-5-16 18:47 , Processed in 0.021251 second(s), 11 queries , Gzip On, Redis On.
Powered by Discuz! X3.5
© 2001-2024 Discuz! Team.