发布于 2013-09-06 11:30:03
1楼
既然是用户登录,那么登录的用户名就是不同的,你用一个变量保存当然登录的用户名,如果保存至和当前值不同,则读取当前时间赋值给一个变量
vbs:
dim tag(3)
tag(0)=hmiruntime.tgas("@currentuser").read
tag(1)=hmiruntime.tgas("currentuser_sav").read
tag(2)=now()
if tag(0)<>"" and tag(1)="" then
hmiruntime.tags("userlogintime").write tag(2)
end if
if tag(0)="" and tag(1)<>"" then
hmiruntime.tags("userlogouttime").write tag(2)
end if
hmiruntime.tgas("currentuser_sav").write tag(0)
userlogintime和userlogouttime两个变量记录的即使登录和登录的时刻,然后计算两个时间差就可以了。
活到老,学到老!为了生活学习吧!