从 940801 兄的主页上(940801.delphibbs.com) 上抄的:<br>function ExpandEnvirnnmentVariable(const ShortEnvVarName: string): string;<br>var<br> Buffer : array[0..MAX_PATH] of Char;<br>begin<br> SetString(Result, Buffer, ExpandEnvironmentStrings(PChar(ShortEnvVarName), Buffer, MAX_PATH));<br>end;<br>用法:<br> Edit1.Text := ExpandEnvirnnmentVariable('%UserProFile%'): <br>