通过设备启动Web UI [英] Launching Web UI thru device

查看:62
本文介绍了通过设备启动Web UI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想在设备插入系统后立即启动Web GUI。我们有什么方法可以做到这一点。是否可以使用任何Web开发语言(例如PHP)。



Regds

SNI

Hi,
I want to launch a Web GUI as soon as I plugged in the device to system. Is there any way by which we can do this. Is it possible using any web development language (e.g. PHP).

Regds
SNI

推荐答案

您无法通过Web应用程序执行此操作。出于明显的安全原因,Web的设计方式是无法编写任何可能迫使客户端执行任何操作的远程应用程序。特别是,Web应用程序无法访问客户端系统,一切都是通过客户端的请求发生的。此外,如果你提到你想要基于任何安装的浏览器做一些事情,那么它应该意味着它不应该假设任何浏览器此时都被执行了,那么PHP甚至可以讨论什么呢?



Microsoft ActiveX中的一个排除项。您可以安装网页上使用的ActiveX组件。但是1)这只适用于某些系统(几乎只有Microsoft)和兼容的浏览器,因此它非常有限,请参阅下文;你必须忘记安装任何浏览器; 2)Web的ActiveX组件被认为是一种非常不安全的特性,因为它与上述安全原则相矛盾; 3)您仍然需要在检测时运行浏览器。



只有开发了一些客户端软件并将其分发给客户端才能解决此类问题他们的同意。 (如果用户在物理上获得加密狗,则意味着可以随身携带一些软件。)此软件应安装在客户端,并且与Web应用程序无关。现在,与Web编程相反,问题在于您只能为有限的一组不同系统开发此类软件。如果你想制作一个浏览器插件(这很自然,想象一下,机制是可行的,浏览器正在工作;当用户插入加密狗时,会检测到这个,然后浏览器会在某个URI处请求某些东西),你也将仅限于一些浏览器及其版本。检测加密狗很有可能(我希望这是一个USB加密狗);如果您搜索Code Project,您可以找到许多关于USB设备检测的文章:

检测硬件插入和/或删除 [ ^ ],

硬件更改检测 [ ^ ],

查找更多内容: http ://www.codeproject.com/search.aspx?q = USB + detect& doctypeid = 1 [ ^ ]。



毕竟你应该知道,如果你插入,例如xample是几乎所有带有UI的计算机系统中的USB存储设备,您会收到有关安装,格式化或浏览检测到的媒体的通知。你也可以做到的。但同样,你需要为某些特定用户的平台做这件事,这是一个非常有限的因素。







是的,您也可以在Windows服务中获取USB通知。要开发Windows服务,请从这里开始:

http:// msdn .microsoft.com / zh-CN / library / y817hyb6.aspx [ ^ ],

http://msdn.microsoft.com/en-us/library/40xe80wx%28v=vs.90%29.aspx [ ^ ]。



此CodeProject文章也很有帮助: C ++中的简单Windows服务 [ ^ ] 。



请记住,你必须大大改进你的项目,这是一项服务。首先,您不能使用任何UI(因为当每个人都注销时服务一直在运行,因此没有桌面来托管任何UI)。通常的方法是有一个单独的UI应用程序,当某些用户登录并且桌面可用时,它通过IPC与服务应用程序通信。



我还开发了一个技术,当相同的应用程序可以交互执行或注册为服务控制器下执行的服务。这样做是另一种已知的技术,但不是那么平常。在我的例子中,应用程序的交互部分确实有UI。调试的很大一部分可以在交互模式下完成。



-SA
You cannot do it through a Web application. For apparent security reasons, Web is designed the way that it's not possible to write any remote application which could force a client to do any action. In particular, a Web application cannot get access to a client system, and everything happens by request of a client side. Moreover, if you mention that you want to do something "based on any browser installed", it should mean that it should not assume that any browser is even being executed at this moment, so what PHP can even be discussed?

One exclusion in Microsoft ActiveX. You can install an ActiveX component used on a Web page. But 1) this can work only on certain systems (almost exclusively Microsoft) and compatible browsers, so it is very limiting, please see below; you would have to forget "any browser installed"; 2) ActiveX components for the Web are considered as a very unsafe feature, as it contradicts the security principles mentioned above; 3) you would still need the browser running at the moment of detection.

You can solve such problems only if you develop some client-side software and distribute it to clients on their consent. (If a user get a dongle physically, it means that it is is possible to deliver some software with it.) This software should be installed in client side and it has nothing to do with Web applications. Now, in contrast to Web programming, the problem is that you would be able to develop such software only for limited set of different systems. If you wanted to make a browser plug-in (which would be only natural, imagine that mechanism works is a browser is working; when a user inserts a dongle, this is detected and then the browser will request something at some URI), you would be also limited to some set of browsers and their version. The detection of a dongle is quite possible (I hope this is an USB dongle); if you search Code Project you can find a number of articles on the detection of an USB device:
Detecting Hardware Insertion and/or Removal[^],
Hardware Change Detection[^],
find more: http://www.codeproject.com/search.aspx?q=USB+detect&doctypeid=1[^].

After all you should know, that if you insert, for example, a USB storage device in nearly any computer system with UI, you get a notification asking you about mounting, of formatting, or browsing the detected media. You can do the same. But again, you need to do it for some set of particular user's platforms, which is a very limiting factor.



Yes, you can get the USB notification in a Windows Service as well. For development of the Windows Services, please start here:
http://msdn.microsoft.com/en-us/library/y817hyb6.aspx[^],
http://msdn.microsoft.com/en-us/library/40xe80wx%28v=vs.90%29.aspx[^].

This CodeProject article can also be helpful: Simple Windows Service in C++[^].

Remember that you will have to re-work your projects considerably, to make it a service. First of all, you cannot use any UI (as the service keeps running when everyone is logged off, so there is no a desktop to host any UI). The usual approach is having a separate UI application which communicate to the service application via IPC, when some user is logged on and the desktop is available.

I also developed a technique when the same application can be executed interactively or registered as a service to be executed under the Service Controller. Doing so is yet another known technique, but not so usual. In my case, the interactive part of application does have UI. A big part of debugging can then be done in the interactive mode.

—SA


这篇关于通过设备启动Web UI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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