标签:unit sage alc app bar word system target highlight
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Memo1: TMemo; procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); begin Memo1.Clear; Memo1.Lines.Add(‘WIN目录: ‘ + GetEnvironmentVariable(‘WINDIR‘)); Memo1.Lines.Add(‘系统目录: ‘ + GetEnvironmentVariable(‘SYSTEMROOT‘)); Memo1.Lines.Add(‘系统根目录: ‘ + GetEnvironmentVariable(‘SYSTEMDRIVE‘)); Memo1.Lines.Add(‘当前用户根目录: ‘ + GetEnvironmentVariable(‘HOMEDRIVE‘)); Memo1.Lines.Add(‘当前用户目录: ‘ + GetEnvironmentVariable(‘USERPROFILE‘)); Memo1.Lines.Add(‘当前用户路径: ‘ + GetEnvironmentVariable(‘HOMEPATH‘)); Memo1.Lines.Add(‘当前用户临时文件夹: ‘ + GetEnvironmentVariable(‘TMP‘)); Memo1.Lines.Add(‘当前用户临时文件夹: ‘ + GetEnvironmentVariable(‘TEMP‘)); Memo1.Lines.Add(‘当前用户数据文件夹: ‘ + GetEnvironmentVariable(‘APPDATA‘)); Memo1.Lines.Add(‘程序默认安装目录: ‘ + GetEnvironmentVariable(‘PROGRAMFILES‘)); Memo1.Lines.Add(‘文件通用目录: ‘ + GetEnvironmentVariable(‘COMMONPROGRAMFILES‘)); Memo1.Lines.Add(‘当前用户名: ‘ + GetEnvironmentVariable(‘USERNAME‘)); Memo1.Lines.Add(‘所有用户文件目录: ‘ + GetEnvironmentVariable(‘ALLUSERSPROFILE‘)); Memo1.Lines.Add(‘操作系统名: ‘ + GetEnvironmentVariable(‘OS‘)); Memo1.Lines.Add(‘计算机名: ‘ + GetEnvironmentVariable(‘COMPUTERNAME‘)); Memo1.Lines.Add(‘处理器个数: ‘ + GetEnvironmentVariable(‘NUMBER_OF_PROCESSORS‘)); Memo1.Lines.Add(‘处理器芯片架构: ‘ + GetEnvironmentVariable(‘PROCESSOR_ARCHITECTURE‘)); Memo1.Lines.Add(‘处理器型号: ‘ + GetEnvironmentVariable(‘PROCESSOR_LEVEL‘)); Memo1.Lines.Add(‘处理器修订号: ‘ + GetEnvironmentVariable(‘PROCESSOR_REVISION‘)); Memo1.Lines.Add(‘包含用户帐号的域: ‘ + GetEnvironmentVariable(‘USERDOMAIN‘)); Memo1.Lines.Add(‘COMSPEC: ‘ + GetEnvironmentVariable(‘COMSPEC‘)); Memo1.Lines.Add(‘执行文件类型: ‘ + GetEnvironmentVariable(‘PATHEXT‘)); Memo1.Lines.Add(‘搜索路径: ‘ + GetEnvironmentVariable(‘PATH‘)); end; end.
-------------------------------------------------------------------------------------------------
object Form1: TForm1 Left = 288 Top = 184 Width = 882 Height = 675 Caption = ‘Form1‘ Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = ‘MS Sans Serif‘ Font.Style = [] OldCreateOrder = False OnCreate = FormCreate PixelsPerInch = 96 TextHeight = 13 object Memo1: TMemo Left = 0 Top = 0 Width = 866 Height = 636 Align = alClient Lines.Strings = ( ‘Memo1‘) ScrollBars = ssVertical TabOrder = 0 end end
获取系统环境变量-GetEnvironmentVariable
标签:unit sage alc app bar word system target highlight
原文地址:https://www.cnblogs.com/delx/p/11320146.html