<p>What's the best way to shut down the computer from a C# program?</p>

<p>I've found a few methods that work - I'll post them below - but none of them are very elegant. I'm looking for something that's simpler and natively .net.</p>

You can launch the shutdown process:
```
shutdown -s -t 0
```
- Shutdown
```
shutdown -r -t 0
```
- Restart