您的位置:首页 > 其它

TDirectory.GetLastAccessTime获取指定目录最后访问时间

2013-12-31 22:53 525 查看
使用函数:

  System.IOUtils.TDirectory.GetLastAccessTime

函数定义:

class function GetLastAccessTime(const Path: string): TDateTime; static;


说明: 参数为指定目录,返回最后一次访问时间(每次访问了某个目录如果下次不在访问,则都属于最后一次访问)

异常处理:指定目录不存在或无效

示例:

var
sDir: string;
begin
if not SelectDirectory('', 'H:\tmp', sDir) then Exit;
try
Edit_Time.Text := DateTimeToStr(TDirectory.GetLastAccessTime(sDir));
except
on e: Exception do
begin
MessageDlg(e.ClassName + e.Message, mtError, [mbok], 0);
Exit;
end;
end;

end;


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐