net cf重启和关闭系统

[DllImport("Aygshell.dll")] static extern bool ExitWindowsEx(uint uFlags, int dwReserved); private const uint EWX_REBOOT = 2; private const uint EWX_POWEROFF = 8; ///重启操作系统 public static void ResetWindows() { ExitWindowsEx(EWX_REBOOT, 0); } ///关闭操作系统 public static void ShutDownWindows() { ExitWindowsEx(EWX_POWEROFF, 0); }

你可能感兴趣的:(net cf重启和关闭系统)