简体   繁体   中英

How to add time based restrictions to prevent a Windows user from logging in?

I am trying to add some modification to the windows login screen that only allows a user to log in if they have time remaining for that day. I also want to allow them to increase the time via a connection with the wireless device.

I have seen similar things done, with Asus Face Login, and Bluetooth login, and I would have no problem writing the code, but how do I put the restrictions at the login screen?

Am I correct in the assumption that this can also only be done using C++? If so, I program mainly in java, so when environments would you recommend forC++?

Any suggestions and links to resources are appreciated! Thanks

I am not pretty much sure but that can be done as follows: There is task scheduler in windows that gives user a feature to run a particular program at log on. So you can develop a program that will run at log on.

Program can be something like that: Firstly, it will get the current user, check for the time available with the user. This can be done by saving time spent by the user in internal database or file.

If user has crossed the specified limit then it will write the details in file/database and fire system("Logoff") command. Logoff is windows command to logoff.

Further on each successfull login it will keep the time of loging in and while logging off it will update the time difference in the file/database.

This is how I suppose it can be implemented. If you have some better way please share.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM