我有基于web的应用程序,它自动加载到客户端计算机上的铬浏览器上的自助服务终端模式(全屏),这是由Windows 7支持的。我想在网页上放置一个关机按钮,以便用户可以直接关机电脑。
- 有没有可能做到这一点?
- Windows和Windows 的最佳解决方案是什么? Linux?
-PS -
我完全控制客户端电脑。 (安装其他软件或浏览器扩展)。它是一个触摸屏POS机。
解决方案由于您可以控制目标机器,所以这是完全可行的。一种方法是通过引入一个单独的组件来执行关闭。
创建控制台应用程序(使用C#例如)监听stdin,当它接收到正确的输入时关闭机器。从C#机器关机并不是完全无关紧要,但Stackoverflow知道它是如何完成的。 注册此应用程序并给定谷歌浏览器原生消息规范。
单个步骤有点过于宽泛,无法在单个答案中详细描述它们,但如果他们给予您的话,您可以随时向他们提出新问题任何麻烦。
I have web based application which automatically loads on kiosk mode (full-screen) in chromium web browser on client's Computer wich is powered by Windows 7. I want to place a shutdown button on web page, so that user can directly shutdown the computer.
- Is there any possibility to achieve this?
- What are the best solutions for both Windows & Linux?
-P.S-
I've full control over client's computer. (installing other software or browser extensions). it is a touch screen POS unit.
解决方案As you have control over the target machine, this is completely feasible. One way to do it is by introducing a separate component to perform the shutdown.
Create a console application (using C#, for example) that listens to stdin, that shuts down the machine when it receives the right input. Machine shutdown from C# is not entirely trivial, but Stackoverflow knows how it is done.
Register this application with a proper manifest given the Google Chrome Native Messaging specification.
Call this extension from your webpage (on shutdownButton.click(), for instance) using Message Passing.
The individual steps are a bit too broad to fully detail them in a single answer, but you can always open new questions on them if they give you any trouble.
更多推荐
通过网页关闭电脑
发布评论