type
TSystemInfo = (
siCompName,
siWinDir,
siTempPath
);
// ....
function getSysInfo(const Info: TSystemInfo): String;
const
size: DWORD = 255;
var
buf: PChar;
begin
GetMem(buf, size);
case Info of
siCompName: GetComputerName(buf, size);
siWinDir: GetWindowsDirectory(buf, size);
siTempPath: GetTempPath(size, buf);
end;
Result := buf;
FreeMem(buf, size);
end;
// ...
someString := getSysInfo(siTempPath);
Вывод системной информации |