见链接:http://askubuntu.com/questions/177348/how-do-i-disable-the-screensaver-lock If you want to wrap your app in a script that takes care of this for you when you launch it (or GUI simply isn't an option), the best command-line solution as of Ubuntu 1…
原文:.NET/C# 阻止屏幕关闭,阻止系统进入睡眠状态 在 Windows 系统中,一段时间不操作键盘和鼠标,屏幕便会关闭,系统会进入睡眠状态.但有些程序(比如游戏.视频和演示文稿)在运行过程中应该阻止屏幕关闭,否则屏幕总是关闭,会导致体验会非常糟糕. 本文介绍如何编写 .NET/C# 代码临时阻止屏幕关闭以及系统进入睡眠状态. 本文内容 Windows API API 封装 Windows API 我们需要使用到一个 Windows API: /// <summary> /// Enabl…