The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
You'll need to use WinAPI for that, .Net does not handle that natively.
Here's a site that will help you:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog/functions_by_category.asp
You'll probably want to use the Advapi32.lib:
BOOL InitiateSystemShutdownEx(
LPTSTR lpMachineName,
LPTSTR lpMessage,
DWORD dwTimeout,
BOOL bForceAppsClosed,
BOOL bRebootAfterShutdown,
DWORD dwReason
);