gpt4 book ai didi

delphi - FileAge无法使用“c:\pagefile.sys”

转载 作者:行者123 更新时间:2023-12-03 18:25:08 25 4
gpt4 key购买 nike

有人知道为什么FileAge无法使用“ c:\ pagefile.sys”吗?
返回-1。

更新:
发现它:这是Delphi 2010(QC Entry 73539)中修复的一个Delphi错误,但是我发现的the PDF没有说明他们如何解决它。

有谁知道他们如何修复它,以便我可以修复我的Delphi 7?

更新:
Radu Barbu提供的优雅修复!



Delphi 7,Win 7(32位)

最佳答案

试试这个:

使用类型为TSearchRec(wSr的波纹管)的变量加载pagefile.sys,然后

wSR.FindData.ftLastWriteTime-访问文件时应返回

并具有波纹管功能,您应该有时间

function FileTime2DateTime(FileTime: TFileTime): TDateTime;
var
LocalFileTime : TFileTime;
SystemTime : TSystemTime;
begin
Result := 0;
try
FileTimeToLocalFileTime(FileTime, LocalFileTime);
FileTimeToSystemTime(LocalFileTime, SystemTime);
Result := SystemTimeToDateTime(SystemTime);
except on e: Exception do
//some message if you want
end;
end;


最好的祝福,

关于delphi - FileAge无法使用“c:\pagefile.sys”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3825077/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com