如何将网页停留时间写入数据库
通过链接进入一页面,我以如下方式获取页面停留时间值(不知正确否)
<script language="c#" runat=server>
datetime starttime;
void page_init (object sender, eventargs e)
{
starttime = datetime.now;
}
protected override void render(htmltextwriter writer)
{
base.render(writer);
datetime endtime = datetime.now;
}
</script>
却不知怎样写入数据库,请高手指点,谢谢!