在Delphi中
一
Lbl_DriveType:Tlabel;
DriveType:WORD; //定義驅動器類型變量
DriveType:=GetDriveType(RootPathName); //獲得RootPathName所對應的磁盤驅動器信息
case DriveType of
DRIVE_REMOVABLE:Lbl_DriveType
DRIVE_FIXED : Lbl_DriveType
DRIVE_REMOTE: Lbl_DriveType
DRIVE_CDROM: Lbl_DriveType
DRIVE_RAMDISK: Lbl_DriveType
end; //將該磁盤信息顯示在Lbl_DriveType中
二
MemStatus: TMEMORYSTATUS; //定義內存結構變量
Lbl_Memory:Tlabel;
MemStatus
S);
GlobalMemoryStatus(MemStatus); //返回內存使用信息
Lbl_Memory
//將內存信息顯示在Lbl_Memory中
三
SysInfo: TSYSTEMINFO;
Lbl_CPUName:Tlabel;
GetSystemInfo(SysInfo);//獲得CPU信息
case SysInfo
PROCESSOR_INTEL_
PROCESSOR_INTEL_
PROCESSOR_INTEL_PENTIUM:Lbl_CPUName
berOfProcessors
PROCESSOR_MIPS_R
PROCESSOR_ALPHA_
end;//把CPU信息顯示在Lbl_CPUName中
From:http://tw.wingwit.com/Article/program/Delphi/201311/8514.html