Re:c#实现关机,注销,重启源代码 另一份代码 using System; using System
Drawing; using System
Collections; using System
ComponentModel; using System
Windows
Forms; using System
Data; using System
Management; using System
Runtime
InteropServices; //加入此名字间是为了引用Windows API 来实现关机 namespace RebootComputer { public class Form1 : System
Windows
Form { //---------------这部分都是控件-------- private System
Windows
Button Reboot; private System
Windows
Button ShutDown; private System
ComponentModel
Container components = null; private System
Windows
Button Exit; //--------------------------------------------------------- private ManagementObjectSearcher obj ; //-----------------程序初始化---------------- public Form1() { InitializeComponent(); } //-----------------------程序释放---------------------- protected