用 GetEnvironmentVariable 获取系统变量

GetEnvironmentVariable 获取系统变量

DWORD WINAPI GetEnvironmentVariable(
  __in_opt   LPCTSTR lpName, //环境变量名
  __out_opt  LPTSTR lpBuffer, //接收的得到的路径的buffer
  __in       DWORD nSize //buffer大小
);

失败返回0;

成功返回得到的buffer的大小,如果nSize太小,返回需要的buffer的大小


GetEnvironmentVariable("TEMP",Buffer,MAX_PATH);


%WINDIR%                 {系统目录- C:\WINDOWS}
%SYSTEMROOT%             {系统目录- C:\WINDOWS}
%SYSTEMDRIVE%            {系统根目录- C:}
%HOMEDRIVE%              {当前用户根目录- C:}
%USERPROFILE%            {当前用户目录- C:\Documents and Settings\wy}
%HOMEPATH%               {当前用户路径- \Documents and Settings\wy}
%TMP%                    {当前用户临时文件夹- C:\DOCUME~1\wy\LOCALS~1\Temp}
%TEMP%                   {当前用户临时文件夹- C:\DOCUME~1\wy\LOCALS~1\Temp}
%APPDATA%                {当前用户数据文件夹- C:\Documents and Settings\wy\Application Data}
%PROGRAMFILES%           {程序默认安装目录- C:\Program Files}
%COMMONPROGRAMFILES%     {文件通用目录- C:\Program Files\Common Files}
%USERNAME%               {当前用户名- wy}
%ALLUSERSPROFILE%        {所有用户文件目录- C:\Documents and Settings\All Users}
%OS%                     {操作系统名- Windows_NT}
%COMPUTERNAME%           {计算机名- IBM-B63851E95C9}
%NUMBER_OF_PROCESSORS%   {处理器个数- 1}
%PROCESSOR_ARCHITECTURE% {处理器芯片架构 - x86}
%PROCESSOR_LEVEL%        {处理器型号- 6}
%PROCESSOR_REVISION%     {处理器修订号- 0905}
%USERDOMAIN%             {包含用户帐号的域- IBM-B63851E95C9}
%COMSPEC%                {C:\WINDOWS\system32\cmd.exe}
%PATHEXT% {执行文件类型 -.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.pyo;.pyc;.py;.pyw}
%PATH%    {搜索路径}
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Delphi 7.1 Update Release Notes=======================================================This file contains important supplemental and late-breakinginformation that may not appear in the main productdocumentation, and supersedes information contained in otherdocuments, including previously installed release notes.Borland recommends that you read this file in its entirety.NOTE: If you are updating a localized version of Delphi 7, visit the Borland Registered User web site to obtain a localized readme file that may contain important late- breaking information not included in this readme file.IMPORTANT: Delphi must be closed before installing this update. =====================================================CONTENTS * INSTALLING THIS UPDATE * UPDATING LOCALIZED VERSIONS OF DELPHI 7 * KNOWN ISSUES * ISSUES ADDRESSED BY THIS UPDATE - IDE - CORE DATABASE - DATASNAP - DBGO (ADO COMPONENTS) - dbExpress - dbExpress COMPONENTS AND DB VCL - dbExpress CORE DRIVER AND METADATA - dbExpress VENDOR ISSUES - dbExpress CERTIFICATION - WEB SNAP - ACTIVEX - COMPILER - RTL - VCL - THIRD PARTY - BOLD FOR DELPHI * VERIFYING THAT THE UPDATE WAS SUCCESSFUL * FILES INSTALLED BY THIS UPDATE =======================================================INSTALLING THIS UPDATE* This update can not be applied to Delphi 7 Architect Trial version. * This update can not be removed after it is installed.* You will need the original Delphi 7 installation CD available to install this update.* To install this update from the CD, insert the CD, and launch the d7_ent_upd1.exe file appropriate for your locale.* To install this update from the Web, double-click the self-executing installation file and follow the prompts. * The Delphi 7 documentation PDF files are available on the update CD.========================================================UPDATING LOCALIZED VERSIONS OF DELPHI 7* This update can be applied only to the English version of Delphi 7. There are separate updates for the German, French and Japanese ver

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值