2009-11-09 44 views

回答

2

您可以將電腦從睡眠中喚醒,我不確定是否有休眠。 This example告訴你如何去做。總之你使用這兩個進口:

[DllImport("kernel32.dll")] 
public static extern SafeWaitHandle CreateWaitableTimer(IntPtr lpTimerAttributes, bool bManualReset, string lpTimerName); 

[DllImport("kernel32.dll", SetLastError = true)] 
[return: MarshalAs(UnmanagedType.Bool)] 
public static extern bool SetWaitableTimer(SafeWaitHandle hTimer, [In] ref long pDueTime, int lPeriod, IntPtr pfnCompletionRoutine, IntPtr lpArgToCompletionRoutine, bool fResume); 

我只測試它在Windows Vista和7,這些可能不可用在XP上。

1

我知道這是VB而不是C#,但看看this example,它確實需要您的主板滿足某些要求。

相關問題