如何计算打开文档的时间&查看...? [英] How to calculate the time a document was opened & viewing...?

查看:216
本文介绍了如何计算打开文档的时间&查看...?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想计算某个特定人在我的站点中打开(查看)文档的时间,请让我知道执行此操作的方法.

这就是我要做的.
我的网站上有一个文档.
(此处的文档"是指任何类型的文档,例如:word,excel,pdf,.ppt等)
一个人登录了我的网站.
他打开该文档.
有时,他关闭了该文档.

我需要知道从他打开到关闭的时间.
简而言之,我想跟踪他查看我的文档的时间)

预先感谢.

I want to calculate the time that a particular person was opening( viewing) a document in my site, please let me know about a way of doing this.

This is what I want to do.
There is a document in my website.
( Here "document" means any kind of document, ex: word,excel,pdf, .ppt, etc )
One person logs into my website.
He opens that doc.
After sometimes he closes that document.

I need to know the time from when he opened it & to when he closed.
That means , in simple,I want to track the time he was viewing my document)

Thanks in advance.

推荐答案

您看到的,您只能为HTTP请求之间的持续时间计时.

当您的用户打开文档时,情况并非如此.什么是开放"?用户发送HTTP请求,您将收到它,开始计算时间……但是在服务器将文档发送给用户之后,无论您做什么,用户都可以永远查看它.没有关闭"事件,也不能在那里.例如,您可以人为地创建此类事件,然后使用Ajax将其发布回去,但是用户可能合作也可能不合作.用户始终可以下载文档并永久使用.

您应该了解,页面或任何其他文档已发送回客户端,它在那里;您无法控制其使用寿命.现在,用户可以决定将其保留多长时间.

您可以安排的唯一持续时间是会话的持续时间,但这与您想要的时间截然不同.

—SA
You see, you can only time the duration between HTTP requests.

This is not the case when your user opens a document. What is "open"? The user sends HTTP request, you receive it, start counting time… but after the server has sent the document to the user, and the user can view it forever, no matter what you do. There is no "close" event, and it can not be there. You can artificially create such event and post it back using Ajax, for example, but the user may or may not cooperate. The user can always download the document and use it forever.

You should understand, it a page or any other document is sent back to the client, it''s there; you don''t have any control of its life time. Now the user decides for how long time it will be kept.

The only duration you can time is the duration of the session, but it''s very different from what you want.

—SA


这篇关于如何计算打开文档的时间&查看...?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆