/// <summary> /// 절점모드 중지 /// </summary> public static void PreventSleep() { Win32Tool.SetThreadExecutionState(ExecutionStateKinds.ES_CONTINUOUS | ExecutionStateKinds.ES_SYSTEM_REQUIRED | ExecutionStateKinds.ES_AWAYMODE_REQUIRED | ExecutionStateKinds.ES_DISPLAY_REQUIRED); }
public static void SetSystemTime(DateTime Time) { var v = new SYSTEMTIME() { wYear = (short)Time.Year, wMonth = (short)Time.Month, wDay = (short)Time.Day, //wDayOfWeek = (short)Time.DayOfWeek, wHour = (short)Time.Hour, wMinute = (short)Time.Minute, wSecond = (short)Time.Second, wMilliseconds = (short)Time.Millisecond, }; Win32Tool.SetSystemTime(ref v); }
/// <summary> /// 절전모드 재개 /// </summary> public static void AllowSleep() { Win32Tool.SetThreadExecutionState(ExecutionStateKinds.ES_CONTINUOUS); }