通过让鼠标的光标自动定时移动,即模拟我们手动移动鼠标,来防止或唤醒显示器休眠:
Cursor.Position = new Point(Cursor.Position.X - 10, Cursor.Position.Y - 10);
System.Threading.Thread.Sleep(500);
Cursor.Position = new Point(Cursor.Position.X + 10, Cursor.Position.Y + 10);
以上结合Timer即可实现。