通过网页关闭计算机 [英] Shutdown computer via web page

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

问题描述

我有一个基于网络的应用程序,它在客户端计算机上的 Chrome 网络浏览器中自动加载信息亭模式(全屏),由 Windows 7 驱动.我想在网页上放置一个关闭按钮,以便用户可以直接关闭电脑.

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.

  • 有没有可能实现这一目标?
  • 什么是最好的解决方案Windows 和Linux?

-P.S-

我可以完全控制客户的计算机.(安装其他软件或浏览器扩展).这是一个触摸屏POS机.

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. 创建一个监听标准输入的控制台应用程序(例如使用 C#),当它接收到正确的输入时关闭机器.从 C# 关闭机器并不是一件小事,但 Stackoverflow 知道它是如何完成的.

根据 Google Chrome Native Messaging 使用适当的清单注册此应用程序规范.

使用 Message 从您的网页(例如在 shutdownButton.click() 上)调用此扩展程序通过.

各个步骤过于宽泛,无法在一个答案中完整详细说明,但如果它们给您带来任何麻烦,您可以随时提出新问题.

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天全站免登陆