delphi 获取临时文件夹路径

//声明:
GetTempPath(
  nBufferLength: DWORD; {缓冲区大小}
  lpBuffer: PChar       {缓冲区}
): DWORD;               {返回实际长度}

//举例:
var
  arr: array[0..MAX_PATH] of Char;
  num: DWORD;
begin
  num := GetTempPath(MAX_PATH, arr);
  ShowMessage(arr);           {C:\DOCUME~1\wy\LOCALS~1\Temp\}
  ShowMessage(IntToStr(num)); {29}
end;

你可能感兴趣的:(DELPHI,VS,PASCAL)