View Single Post
  #3  
Old 12-18-2006, 11:03 PM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,318
Default RE: Best way to get Windows Temp Directory

And I always use this one:
Code:
function TempFolder: String;
var
  bufFolder: array [0..MAX_PATH] of Char;
begin
  GetTempPath(SizeOf(bufFolder), bufFolder);
  Result := IncludeTrailingPathDelimiter(String(bufFolder));
end;
So you see, it's all a matter of personal flavor...
Only one I wouldn't use is the GetEnvironmentVar, because it goes directly to environment variables... This depends on a variable that I can modify by hand... The GetTempPath method is windows API, so I choose this one...

Objective reality is a delirium caused by lack of alcohol in blood.
There is no place like 127.0.0.1
Reply With Quote