Possible Duplicate:
How cancel shutdown from a windows service C#
I have windows service that should transfer file to nas storage, now the problem is that these files are very important and must not be interupted by windows shutdown or restart,
I want to do something looks like windows updating, when a user hit shut down while the service transfering files in queue, windows should wait until all files are transfered then performing shutdown or restart.
like in this image: http://www.7tutorials.com/files/img/ie9_uninstall/unie93.png
how to do this in c#.net?