I have a Windows service that should run on a PC that is left for 24 hours.
I cannot rely on a PC that has the shutdown / shutdown function disabled because it is something installed on 3,500 sites, and X, Y or Z may mean that sleep / shutdown mode is not turned off.
Is there some neat .NET way I can get Windows to delay?
Or will it be periodically written to a file (for example, write the date once a minute)?
Please do not report lateral / incorrect practices "you should not force such things, leave them on the computer." It is my job to make sure that this program achieves this on client computers!
Hooray!
Edit:
[Big sigh]
As usual, the sides cannot help but comment. I tried to dissuade, to avoid the need to explain, to justify myself, but hey. This did not work. People assumed that I was trying to get hold of "THEM" computers.
It is intended for the corporate client and monitors actions on security hardware and registers it. As someone opens the door with an electronic key.
Since the doors must function 24 hours a day, they obviously want to keep a journal 24 hours a day.
This is not a crime. They have many sites where they want this to happen. They cannot rely on personnel who disable hibernation / sleep functions. So they asked me to make sure that he could stay alive.
Again, this is really not a crime. Sometimes these things just have to happen.
I do not like to justify every question I ask here. The real world is just not as neat and fluffy as we all would like.
On a more positive note, many thanks to those who helped!