zoukankan      html  css  js  c++  java
  • Delphi 解析系统环境变量

    // http://www.outofmemory.cn
    function ExpandEnvironment(const strValue: string): string;
    var
      chrResult: array[0..1023] of Char;
      wrdReturn: DWORD;
    begin
      wrdReturn := ExpandEnvironmentStrings(PChar(strValue), chrResult, 1024);
      if wrdReturn = 0 then
        Result := strValue
      else 
      begin
        Result := Trim(chrResult);
      end;
    end;
       
    使用范例 EditPath.Text :
    = ExpandEnvironment('%systemroot%Temp'); 在windows下输入如下结果 C:WindowsTemp
  • 相关阅读:
    设计模式
    设计模式
    设计模式
    设计模式
    设计模式
    设计模式
    OpenGL学习 (一)
    C#
    Unity
    [开发ing] Unity项目
  • 原文地址:https://www.cnblogs.com/yzryc/p/6276985.html
Copyright © 2011-2022 走看看