Is it possible, without employing pinvoke, to restart a PC using .NET?
I kind of just repeated the title, but I'm not too sure how to elaborate much further!
Edit:
I should have mentioned that don't want to use "shutdown -r" as a solution.
I was really after a pure .NET way, something like:
Environment.ShutDown();
In other words, something that is maintained with .NET as new versions of Windows arise.
Edit 2:
Please stop asking "what's wrong with p/invoke". Those sort of answers are exactly what SO users seem to love; the supposed "lateral" approach to answering a question. However, although there is no real problem with p/invoke and I will happily use it, what on earth is wrong with asking if .NET has a more official way of achieving something? If it's in .NET then any API changes between OSes will (most likely) get reflected. Whatever the reason, it's not a crime to seek to minimise DLL import usage is it?
I'm sure if I included something in a question like:
[DllImport("something32.dll")]
static extern int ClimbWall32Ex(IntPtr32 blah);
And you could just do:
SomeNamespace.ClimbWall();
Everyone one here would scream: "what is wrong with using SomeNamespace.ClimbWall();
??"
Sigh.