question

AntonioArochaa0a00uy-6817 avatar image
0 Votes"
AntonioArochaa0a00uy-6817 asked AntonioArochaa0a00uy-6817 commented

How to get the time left from a Windows Session before the active user is locked out of a session?

Hello:

I would like to know, how much time is left before a user is locked out of it's current windows session in c#.

dotnet-csharp
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @AntonioArochaa0a00uy-6817,
>>how much time is left before a user is locked out of it's current windows session in c#.
To avoid misunderstandings, could you please explain in detail and provide more details?
Best Regards,
Daniel Zhang

0 Votes 0 ·

Dear all:

When you configure your profile in Winodws 10, you can configure in your personalization the Screen saver setting the time in which the session will lockout in case there is no activity. The operating system must be keeping track of that time to know when to lock out the screen in case there is no activity.

What I want to know is if there is way in dotnet C# to obtain the remaning time before the computer locks the screen or activates the screen saver (I suspect they are link toguether).

Thank you for your help.

Kind regards

0 Votes 0 ·

1 Answer

RLWA32-6355 avatar image
0 Votes"
RLWA32-6355 answered AntonioArochaa0a00uy-6817 commented

Take a look at c-sharp-detect-time-of-last-user-interaction-with-the-os which uses GetLastInputInfo functionand also SystemParametersInfo function retrieving SPI_GETSCREENSAVETIMEOUT.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you very much for the help. This is exacly what I was looking for.
Kind regards

0 Votes 0 ·