Document directory
System APIs must be called to control computers.
Method To Call The system API:
1: using system. runtime. interopservices;
2: Introduce the DLL in the format of [dllimport ("USER32")]
3: API declaration, in the format of internal static extern bool exitwindowsex (INT flg, int rea );
There are many ways to perform operations such as shutdown, logout, and restart.
Http://blog.csdn.net/ylqmf/archive/2010/01/04/5128330.aspx
However, the standby mode is not common.
Use the power management API
Bool winapi setsystempowerstate (
_ In boolFsuspend,
_ In boolFforce
);
Parameters
Fsuspend[In]
-
The parameter is ture system suspension (suspend); the parameter is false, and the system disk is in standby mode (hibernate)
-
Suspend indicates that the current system parameter is saved to the memory, and the CPU power is still on.
-
Hibernate is saved to the hard disk, CPU power off
-
Therefore, the standby and wake-up modes of suspend are faster than those of hibernate.
-
Fforce[In]
-
Invalid
For more information, see http://msdn.microsoft.com/en-us/library/aa373206 (vs.85). aspx