470,810 Members | 866 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,810 developers. It's quick & easy.

How to: issue a shutdown/restart?

Any hints on how have a .NET app issue a shutdown/restart?

Thanks Rob.
Aug 11 '06 #1
2 1068
Hello, Rob!

RRAAny hints on how have a .NET app issue a shutdown/restart?

Use P/Invoke and call ExitWindowsEx win32 api

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Aug 11 '06 #2
"Rob R. Ainscough" <ro*****@pacbell.netwrote:
Any hints on how have a .NET app issue a shutdown/restart?
If you mean an application shutdown and restart, then
Application.Restart() can do the job.

If you mean shutdown or restart the machine, I'm sure there's a way to
do it through System.Management, but a more direct route is the
InitiateSystemShutdown/Ex, called via P/Invoke - http://pinvoke.net has
the right declaration.

-- Barry

--
http://barrkel.blogspot.com/
Aug 11 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Titeuf | last post: by
2 posts views Thread by Sin Jeong-hun | last post: by
3 posts views Thread by IdleBrain | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.