📄 systeminfo.pas
字号:
unit SystemInfo;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, Registry, ShlObj, WinSock;
Const
adr_BiosName = $FE061;
adr_BiosCopyright = $FE091;
adr_BIOSExtendedInfo = $FEC71;
adr_BiosDate = $FFFF5;
type
tOnRefreshInfo = procedure(Sender: TObject;InfoCategory:String) of object;
tDriveType = (dtUnknown, dtRootNotFound, dtRemovable, dtFixed, dtRemote, dtCDROM, dtRAMDisk);
tFileSystemFlag = (fsCaseIsPreserved,fsCaseSensitive,fsUnicodeStoredOnDisk,fsPersistentAcls,fsFileCompression,fsVolIsCompressed);
tFileSystem = Set of TFileSystemFlag;
TKeyboard = Class(TPersistent)
private
FNumLock : Boolean;
FScrollLock : Boolean;
FCapsLock : Boolean;
protected
public
constructor Create;
destructor Destroy;override;
procedure RefreshInfo;
published
property Numlock : Boolean Read FNumlock Write FNumlock;
property ScrollLock : Boolean Read FScrollLock Write FScrollLock;
property Capslock : Boolean Read FCapslock Write FCapslock;
end;
TDisplay = Class(TPersistent)
private
FChipType : String;
FDACType : String;
FRevision : String;
FAGP : Boolean;
F3DProcessor : Boolean;
FMemory : String;
FSupportedModes : tstrings;
protected
public
constructor Create;
destructor Destroy;override;
procedure RefreshInfo(AdapterIndex:Integer);
published
property ChipType : String Read FChipType Write FChipType;
property DACType : String Read FDACType Write FDACType;
property Revision : String Read FRevision Write FRevision;
property AGP : Boolean Read FAGP Write FAGP;
property Processor3D : Boolean Read F3dProcessor Write F3dProcessor;
property Memory : String Read FMemory Write FMemory;
property SupportedModes: tStrings Read FSupportedModes;
end;
TNetwork = Class(TPersistent)
private
FNetAdap : tstrings;
FNetCli : tStrings;
FNetProto : tStrings;
FLocalIP : String;
FLocalHost: String;
protected
public
constructor Create;
destructor Destroy;override;
procedure RefreshInfo;
published
property Adapter : tStrings Read FNetAdap;
property Clients : tstrings Read FNetCli;
property Protocols : tstrings Read FNetProto;
property LocalIP : String Read FLocalIP write FLocalIP;
property LocalHost : String Read FLocalHost Write FLocalHost;
end;
TDirectX = Class(TPersistent)
private
FVersion : String;
FDirect3dDrvDesc : tStrings;
FDirectMusicDrvDesc : tStrings;
FDirectPlayDrvDesc : tstrings;
protected
public
constructor Create;
destructor Destroy;override;
procedure RefreshInfo;
published
property Version : String Read FVersion Write FVersion;
property Direct3D : tstrings Read FDirect3dDrvDesc;
property DirectMusic : tstrings Read FDirectMusicDrvDesc;
property DirectPlay : tstrings Read FDirectPlayDrvDesc;
end;
TDevice = Class(TPersistent)
private
F3DAccel : tStrings;
FAdapter : tStrings;
FSystem : tstrings;
FUSB : tstrings;
FPorts : tStrings;
FMedia : tstrings;
FPrinter : tStrings;
FSCSI : tStrings;
FModem : tStrings;
FMonitor : tStrings;
FKeyBoard : tStrings;
FMouse : tStrings;
FCdRom : tStrings;
FPCMCIA : tstrings;
FInfraRed : tStrings;
FMultiFun : tStrings;
FHDC : tStrings;
FFDC : tStrings;
protected
public
constructor Create;
destructor Destroy;override;
procedure RefreshInfo;
published
property Accelerators3D : tStrings Read F3dAccel;
property CdRom : tStrings Read FCDROM;
property Adapter: tStrings Read FAdapter;
property System : tStrings Read FSystem;
property USB : tStrings Read FUSB;
property Ports : tStrings Read FPorts;
property Media : tStrings Read FMedia;
property Printer: tStrings Read FPrinter;
property SCSI : tStrings Read FSCSI;
property Modem : tstrings Read FModem;
property Monitor: tstrings read FMonitor;
property Keyboard:tStrings Read FKeyBoard;
property Mouse : tStrings Read FMouse;
property PCMCIASocket : tstrings Read FPCMCIA;
property InfraRed : tStrings Read FInfraRed;
property MultiFunction : tStrings Read FMultiFun;
property HardDiskControllers : tStrings Read FHDC;
property FloppyDiskControllers : tStrings Read FFDC;
end;
TLocaleInfo = Class(TPersistent)
private
FLang : String;
FEngLang : String;
FAbbrLang : String;
FCountry : String;
FFCountry : String;
FAbbrCtry : String;
FList : String;
FMeasure : String;
FDecimal : String;
FDigit : String;
FCurrency : String;
FIntlSymbol: String;
FMonDecSep : String;
FMonThoSep : String;
FCurrdigit : String;
FPCurrMode : String;
FNCurrMode : String;
FDate : String;
FTime : String;
FTimeFormat : String;
FShortDate : String;
FShortDateOrdr : String;
FLongDateOrdr : String;
FTimeFormatSpec: String;
FYearFormat : String;
protected
public
constructor Create;
destructor Destroy;override;
Procedure RefreshInfo(LocaleID:Cardinal);
published
property FullLocalizeLanguage : String Read Flang Write FLang;
property FullLanguageEnglishName : String Read FEngLang Write FEngLang;
property AbbreviateLanguageName : String Read FAbbrLang Write FAbbrLang;
property CountryCode : String Read FCountry Write FCountry;
property FullCountryCode : String Read FFCountry Write FFCountry;
property AbbreviateCountryCode : String Read FAbbrCtry Write FAbbrCtry;
property ListSeparator : String Read FList Write FList;
property SystemofMeasurement : String Read FMeasure Write FMeasure;
property DecimalSeparator : String Read FDecimal Write FDecimal;
property NumberofDecimalDigits : String Read FDigit Write FDigit;
property LocalMonetarySymbol : String Read FCurrency Write FCurrency;
property InternationalMonetarySymbol : String Read FIntlSymbol Write FIntlSymbol;
Property CurrencyDecimalSeparator : String Read FMonDecSep Write FMonDecSep;
property CurrencyThousandSeparator: String Read FMonThoSep write FMonThoSep;
property CurrencyDecimalDigits : string Read FCurrDigit Write FCurrdigit;
property PositiveCurrencyMode : String Read FPCurrMode Write FPCurrMode;
property NegativeCurrencyMode : string Read FNCurrMode Write FNCurrMode;
property DateSeparator : string Read FDate Write FDate;
property TimeSeparator : string Read FTime Write FTime;
property TimeFormat : string Read FTimeFormat Write FTimeFormat;
property ShortDateFormat : string Read FShortDate Write FShortDate;
property ShortDateOrder : string Read FShortDateOrdr Write FShortDateOrdr;
property LongDateOrder : string Read FLongDateOrdr Write FLongDateOrdr;
property TimeFormatSpecifier : string Read FTimeFormatSpec Write FTimeFormatSpec;
property YearFormat : string Read FYearFormat Write FYearFormat;
end;
TTimeZone = Class(TPersistent)
private
FBias : Integer;
FStandardName : string;
FStandardTime : TDateTime;
FDaylightName : String;
FDaylightTime : TDateTime;
FDayLightBias : Integer;
protected
public
constructor Create;
destructor Destroy;override;
procedure RefreshInfo;
published
property Bias : Integer read FBias write FBias;
property StandardName: string read FStandardName write FStandardName;
property StandardTime: TDateTime read FStandardTime write FStandardTime;
property DaylightName: String read FDaylightName write FDaylightName;
property DaylightTime: TDateTime read FDaylightTime write FDaylightTime;
property DayLightBias: Integer read FDayLightBias write FDayLightBias;
end;
TDirectories = Class(TPersistent)
private
FProgramFiles : String;
FCommonFiles : String;
FMedia : String;
FDevice : String;
FConfig : String;
FOtherDevice : String;
FWallpaper : String;
FWindows : String;
FSystem : String;
FTemp : String;
{ Spesial Folder, Win9x ONLY ! }
FDesktop : String;
FInternet : String;
FPrograms : String;
FControls : String;
FPrinters : String;
FPersonal : String; { My Document }
FFavorites : String;
FStartUp : String;
FRecent : String;
FSendTo : String;
FBitBucket : String; { Recycle Bin }
FStartMenu : String;
FDesktopDir : String;
FDrives : String; { My Computer }
FNetWork : String;
FNetHood : String;
FFonts : String;
FTemplates : String;
FCommonStartMenu : String; { Startmenu, For all user }
FcommonPrograms : String;
FCommonStartUp : String;
FCommonDesktopDir: String;
FAppData : String;
FPrintHood : String;
FCommonAltStartUp : String;
FCommonFavorites : String;
FInternetCache : String;
FCookies : String;
FHistory : String;
protected
public
constructor Create;
destructor Destroy;override;
// procedure RefreshInfo;
published
property ProgramFiles : String read FProgramFiles Write FProgramFiles;
property CommonFiles : String Read FCommonFiles write FcommonFiles;
property Media : String Read FMedia write FMedia;
property Device : String Read FDevice write FDevice;
property Config : String Read FConfig write FConfig;
property OtherDevice : String Read FOtherDevice write FOtherDevice;
property Wallpaper : String Read FWallpaper write FWallpaper;
property Windows : String Read Fwindows Write FWindows;
property System : String read FSystem Write Fsystem;
property Temp : String Read FTemp Write FTemp;
{ Spesial Folder, Alphabetical Order }
property AppData : String read FAppData Write FAppData;
// property RecycleBin : String Read FBitBucket Write FBitBucket;
// property CommonAltStartUp: String Read FCommonAltStartUp Write FCommonAltStartUp;
property CommonDesktopDir: String Read FCommonDesktopDir Write FCommonDesktopDir;
// property CommonFavorites : String Read FCommonFavorites Write FCommonFavorites;
// property CommonFiles : String Read FCommonFiles Write FCommonFiles;
// property CommonPrograms : String Read FCommonPrograms Write FCommonPrograms;
// property CommonStartmenu : String Read FCommonStartmenu Write FCommonStartmenu;
// property CommonStartUp : String Read FCommonStartUp Write FCommonStartUp;
// property Config : String read FConfig Write FConfig;
// property Controls : String read FControls Write FControls;
property Cookies : String read FCookies Write FCookies;
property Desktop : String read FDesktop Write FDesktop;
property DesktopDir : String read FDesktopDir Write FDesktopDir;
// property Drives : String read FDrives Write FDrives;
property Favorites : String read FFavorites Write FFavorites;
property Fonts : String read FFonts Write FFonts;
property History : String read FHistory Write FHistory;
// property Internet : String read FInternet Write Finternet;
property InternetCache : String read FInternetCache Write FinternetCache;
property NetHood : String read FNetHood Write FNetHood;
// property NetWork : String read FNetWork Write FNetWork;
property MyDocuments : String read FPersonal Write FPersonal;
// property Printers : String Read FPrinters Write FPrinters;
property PrintHood : String Read FPrintHood Write FPrintHood;
// property Programs : String Read Fprograms Write Fprograms;
property Recent : String read FRecent Write FRecent;
property SendTo : String Read FSendTo Write FSendTo;
property StartUp : String Read FStartup write FStartUp;
property Templates : String Read FTemplates Write FTemplates;
end;
TDisk = Class(TPersistent)
private
FDrive : String;
FDriveType : tDriveType;
FSerialNumber : Integer;
FSerialNumberText : String;
FReady : Boolean;
FVolumeLabel : String;
FFileSystem : String;
FFileSystemFlag : tFileSystem;
{ Delphi Internal Function }
// FDiskSize : String; { In Bytes }
// FDiskFree : String; { In Bytes }
{ GetDiskFreeSpace and GetDiskFreeSpaceEx }
FSectorsPerCluster : String;
FBytesPerSector : String;
FNumberOfFreeCluster : String;
FTotalNumberOfCluster : String;
FTotalNumberOfBytes : String;
FTotalNumberOfFreeBytes : String; { Quotas for the calling thread, refer to WINAPI SDK GetDiskFreeSpaceEx }
FClusterSize : String;
FFreeBytes : String;
Procedure SetDrive(Drive:String);
protected
Procedure GetDiskInfo(Drive:string);
public
constructor Create;
destructor Destroy;override;
procedure RefreshInfo;
protected
published
property Drive : String Read FDrive Write SetDrive;
property DriveType : tDriveType Read FDriveType Write FDriveType;
property SerialNumber : Integer Read FSerialNumber Write FSerialNumber;
property SerialNumberLabel : String Read FSerialNumberText Write FSerialNumberText;
property VolumeLabel : String Read FVolumeLabel Write FVolumeLabel;
property FileSystem : string Read FFilesystem Write FFileSystem;
property FileSystemFlag : tFilesystem Read FFileSystemFlag Write FFileSystemFlag;
property DiskReady : Boolean Read FReady Write FReady;
// property DiskSize : String Read FDiskSize Write FDiskSize;
// property DiskFree : String Read FDiskFree Write FDiskFree;
property SectorsPerCluster : String Read FSectorsPerCluster write FSectorsPerCluster ;
property BytesPerSector : String read FBytesPerSector write FBytesPerSector ;
property FreeCluster : String read FNumberOfFreeCluster write FNumberOfFreeCluster ;
property TotalCluster : String read FTotalNumberOfCluster write FTotalNumberOfCluster ;
property TotalBytes : String read FTotalNumberOfBytes write FTotalNumberOfBytes ;
// property NumberOfFreeBytes : String read FTotalNumberOfFreeBytes write FTotalNumberOfFreeBytes;
property ClusterSize : String read FClusterSize Write FClusterSize;
property FreeBytes : String read FFreeBytes Write FFreeBytes;
end;
TUser = Class(TPersistent)
private
FLocaleInfo : tLocaleInfo;
FUserName : String;
FUsrLangDefID : String;
protected
public
constructor Create;
destructor Destroy;override;
procedure RefreshInfo;
published
property UserName : String read FUsername write FUsername;
property LanguageID : String Read FUsrLangDefID Write FUsrLangDefID;
property LocaleInfo : tLocaleInfo Read FLocaleInfo Write FLocaleInfo;
end;
TCPU = Class(TPersistent)
private
FProcessorArchitecture : Integer;
FProcessorCount : Integer;
FProcessorLevel : Integer;
FProcessorType : String;
FProcessorVersion : String;
FProcessorRevision : Integer; { Hi=Maj, Lo=Min }
FProcessorOEMID : Integer; { NT Only }
FFreq : String; { in MHz }
FCPUID : Boolean;
FVendor : String;
{ CPU ID Properties }
FFamily : integer;
FStepping : Integer;
FModel : Integer;
FType : Integer;
FProcessorID : tStrings; { Assume your computer has multiple Processor }
protected
public
constructor Create;
destructor Destroy;override;
procedure RefreshInfo;
published
property Architecture : Integer Read FProcessorArchitecture Write FProcessorArchitecture;
property Count : Integer Read FProcessorCount Write FProcessorCount;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -