如果鼠标和键盘在ASP.NET和C#中1分钟内没有响应,如何锁定屏幕 [英] How to lock screen if mouse and keyboard not response in 1 minute in ASP.NET and C#

查看:123
本文介绍了如果鼠标和键盘在ASP.NET和C#中1分钟内没有响应,如何锁定屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个应用程序,员工可以手动超时和定时。如果他有自己的时间并且他没有与键盘和鼠标交互,那么应用程序会自动超时自己。



例如,如果我不使用计算机五分钟计算机将自动注销上面应用的相同现象。

i have developed an application in which an employee can time-out and time-in manually. If he has time-in himself and he is not interacting with the keyboard and mouse so the application automatically time-out himself.

For example if i am not using computer for five mins computer will log off automatically the same phenomenon is applied above.

推荐答案

你不能在网页中这样做。首先,您在ASP.NET应用程序中使用C#编写的任何代码仅在服务器上运行,而不是客户端!您将锁定服务器控制台,但不是您在屏幕上看到的控制台。由于ASP.NET代码在IIS中运行并且作为服务运行,因此您将锁定服务桌面,而不是您在显示器上看到的桌面。



You无法从网页内锁定用户桌面。
You can't do that in a web page. First, any code you write in C# in your ASP.NET app runs on the server only, NOT THE CLIENT! You'd be locking the server console, but not the console you see on the screen. Since ASP.NET code runs in IIS and that runs as a service, you'd be locking the service desktop, NOT the desktop you see on the monitor.

You can't lock a users desktop from inside a web page.


如果用户未与网页交互,您可以在一定时间后注销用户。

您必须在 web.config 文件中定义 Timeout

Check- ASP.NET会话状态 [ ^ ]



你也可以去一些 jQuery 的东西。

参考

1. jquery-idleTimeout [ ^ ]

2. jQuery idleTimer插件 [ ^ ]
You can log out the user after certain time, if he/she does not interact with the Web Page.
You have to define the Timeout in web.config file.
Check- ASP.NET Session State[^]

You can also go for some jQuery stuffs.
Refer-
1. jquery-idleTimeout[^]
2. jQuery idleTimer Plugin[^]


你需要用javascript做这个
you need to do that with javascript


这篇关于如果鼠标和键盘在ASP.NET和C#中1分钟内没有响应,如何锁定屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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