http://search.csdn.net/Expert/topic/2542/2542604.xml?temp=.6864282

解决方案 »

  1.   


    using System.Management;
    .................ConnectionOptions co = new ConnectionOptions();
    co.Username = "";//用户名
    co.Password = "";//密码
    string ls_tmp = MachineNameText.Text;
    System.Management.ManagementScope ms = new System.Management.ManagementScope("\\\\" + ls_tmp + "\\root\\cimv2", co);      
    System.Management.ObjectQuery oq = new System.Management.ObjectQuery("SELECT * FROM Win32_OperatingSystem");
                      
    ManagementObjectSearcher query = new ManagementObjectSearcher(ms,oq);
    ManagementObjectCollection queryCollection = query.Get();            
    foreach( ManagementObject mo in queryCollection ) 
    {
    string[] ss={""};
    mo.InvokeMethod("ShutDown",ss);

    }
      

  2.   

    http://wjc.sz.luohuedu.net/xml/ShowDetail.asp?id=1C5E7859-4AB2-4B7F-E29C-9C43136CD98A
      

  3.   

    给你个变相的方法:重定向标准输入输出.然后用shutdown -s关机