views:

1055

answers:

4

I am developing a Windows application using C#.net. This will accept the login details, validate the login and then keep running unattended till the time the computer is on.

This computer won't do anything else and go to standby mode after a few minutes as per the security policy.

Is there a way to configure my application to avoid going to sleep when the computer goes to standby mode and keep the app running? I know we can do this by installing this application as a service. However a service cannot print my data without throwing up a print dialog and therefore, I cannot configure the app as a service.

+8  A: 

I'm not sure I understand completely - you want your app to carry on running WHILE the computer is asleep? If so then there's no way you can do that, it's asleep :) Services don't carry on running when the machine is sleeping either.

It should still be running when the machine wakes back up again though.

Steven Robbins
+1  A: 

If by standby mode you mean a screensaver or locked screen then any standard app will still run. If by standby mode you mean an auto-log out the solution would be to create a windows service. This can be set to run on the system with no active users. If by standby mode you mean in a sleep or hibernate mode then im afraid you're out of luck as the machine wont actually run anything.

Wolfwyrd
+2  A: 

System does not actually work in sleep mode so your app wont either. Please note that basically all what can be done is to perform a wake up.

Kamil Zadora
A: 

To clarify, I mean auto-logout when I say 'standby'. I can understand that once the user is logged out, it is not possible to run the application fired by the user.

Just exploring this friendly community for a way out (work-around).

I have coded the windows service implementation but that is throwing up a print dialog box when the app has to print a html formatted information snippet. The regular app does not fire this dialog box. This is vital for me as the system will run attended.

Can you help me by suggesting some way to avoid the print dialog box while printing through a windows service?

Please update Q, answers don't thread.Also: VERY BAD idea - services should NOT be interactive. The proper solution is to implement a named pipe between GUI app and service. Names pipes can be secured with ACLs etc.
MSalters