示例#1
0
 /// <summary>
 /// 절점모드 중지
 /// </summary>
 public static void PreventSleep()
 {
     Win32Tool.SetThreadExecutionState(ExecutionStateKinds.ES_CONTINUOUS |
                                       ExecutionStateKinds.ES_SYSTEM_REQUIRED |
                                       ExecutionStateKinds.ES_AWAYMODE_REQUIRED |
                                       ExecutionStateKinds.ES_DISPLAY_REQUIRED);
 }
示例#2
0
        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);
        }
示例#3
0
 /// <summary>
 /// 절전모드 재개
 /// </summary>
 public static void AllowSleep()
 {
     Win32Tool.SetThreadExecutionState(ExecutionStateKinds.ES_CONTINUOUS);
 }