我已经将方法更新到 我的CSDN博客里了 http://blog.csdn.net/gaoxiaoweiandy/article/details/7403784
poweroff
system("su -c \"poweroff\"");