通过网页关闭电脑

编程入门 行业动态 更新时间:2024-10-24 14:22:37
本文介绍了通过网页关闭电脑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

  • 有没有可能做到这一点?
  • Windows和Windows 的最佳解决方案是什么? Linux?

-PS -

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

解决方案

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

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

  • 例如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.

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

    更多推荐

    通过网页关闭电脑

    本文发布于:2023-10-26 12:03:02,感谢您对本站的认可!
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:网页   电脑

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!