本文整理自网络,侵删。
uses ShellApi, ShlObj, ComObj, ActiveX;
function GetTempDirectory: string;var lpBuffer: array[0..MAX_PATH] of Char;begin GetTempPath(MAX_PATH, @lpBuffer); Result := StrPas(lpBuffer);end;
procedure TForm1.Button1Click(Sender: TObject);beginshowmessage(GetTempDirectory);end;
相关阅读 >>
Delphi getsys32path()得到系统system32路径
Delphi 实现卸载windows应用程序(类似360软件管家-卸载程序)
更多相关阅读请进入《Delphi》频道 >>