通过网页关闭电脑 [英] Shutdown computer via web page

查看:147
本文介绍了通过网页关闭电脑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有基于web的应用程序,它自动加载到客户端计算机上的铬浏览器上的自助服务终端模式(全屏),这是由Windows 7支持的。我想在网页上放置一个关机按钮,以便用户可以直接关机电脑。


  • 有没有可能做到这一点?

  • Windows和Windows
    的最佳解决方案是什么? Linux?



-PS -



我完全控制客户端电脑。 (安装其他软件或浏览器扩展)。它是一个触摸屏POS机。

解决方案

由于您可以控制目标机器,所以这是完全可行的。一种方法是通过引入一个单独的组件来执行关闭。


  1. 创建控制台应用程序(使用C#例如)监听stdin,当它接收到正确的输入时关闭机器。从C#机器关机并不是完全无关紧要,但Stackoverflow知道它是如何完成的。 注册此应用程序并给定谷歌浏览器原生消息规范

  2. 例如shutdownButton.click())使用消息传递


单个步骤有点过于宽泛,无法在单个答案中详细描述它们,但如果他们给予您的话,您可以随时向他们提出新问题任何麻烦。


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.

  1. 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.

  2. Register this application with a proper manifest given the Google Chrome Native Messaging specification.

  3. 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.

这篇关于通过网页关闭电脑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆