As above, I'd recommend just putting
shutdown -f -t 10 -s
into a batch file and running that. C# is absolutely overkill for this purpose!
The -f in the command is used to force shutdown (even if other programs aren't responding or try to hang.) The -s bit is the bit that's telling it to shut down and the -t 10 means do it in 10 seconds.