如题,谢谢

解决方案 »

  1.   

    Reboot Method of the Win32_OperatingSystem Class
    The Reboot WMI class method shuts down the computer system, then restarts it. On computers running Windows 2000 and Windows NT, the calling process must have the SE_SHUTDOWN_NAME privilege.This topic uses Managed Object Format (MOF) syntax. For information on using this method see Calling a Method.uint32 Reboot();Parameters
    This method has no parameters. 
    Return Values
    Returns zero (0) to indicate success. Any other number indicates an error.Example CodeFor script examples, see WMI Tasks for Scripts and Applications and the TechNet ScriptCenter Script Repository.For C++ example code, see WMI C++ Application Examples.
    Requirements
    Client Requires Windows XP, Windows 2000 Professional, or Windows NT Workstation 4.0 SP4 and later. 
    Server Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0 SP4 and later. 
    MOF Declared in Cimwin32.mof.
     
    DLL Requires Cimwin32.dll.  
    Namespace Defined in \root\cimv2.
     See Also
    Operating System Classes, Win32_OperatingSystem
      

  2.   

    BOOL ExitWindowsEx(UINT uFlags, DWORD dwReason);
    详查MSDN。