I have a Windows service that needs to run on a PC that is left on 24 hours.
I can't rely on the PC having sleep/shut down disabled because it is something being installed on around 3500 sites and X, Y or Z might mean that sleep/shut down is not disabled.
Is there some neat .NET way I can keep Windows from snoozing?
Or would periodically writing to a file (say writing the date once a minute) be suffice?
Please no lateral/bad practice warning "you shouldn't be forcing that sort of thing, leave it up to the computer" answers. It's my job to make sure this program achieves this on the customer's computers!
Cheers!
Edit:
[Big sigh]
As usual the laterals can't help but comment. I did try to dissuade to avoid having to spell out-justify myself, but hey. It didn't work. People assumed I'm trying to take over "THEIR" computers.
It is for a corporate customer and it monitors actions on security hardware and logs it. Like someone opening a door with an electronic key.
As the doors need to be functioning 24 hours a day, they obviously want logging 24 hours a day.
It's not a crime. They have a lot of sites where they want this to happen. They can't rely on staff there turning the hibernate/sleep features off. So they asked me to make sure it can stay alive.
Again, it really isn't a crime. Sometimes these things just have to happen.
I hate having to justify every question I ask on here. The real world just isn't as neat and fluffy as we'd all like it to be.
On a more positive note, big thanks to those who helped!!