如何从网站在客户端上执行应用程序?
我有一个位于服务器上的 ASP.NET / C# 应用程序,我的问题是如何在访问该网站的客户端(服务器上的应用程序)中运行另一个应用程序 (.exe)
问题
(client)------------(server)
run browser website
and (asp.net/c#)
**execute instruction
app.exe** for execute app.exe
我开发了ext.net,一个使用asp.net + c#的软件,它是powerbuilder制作的旧软件的更新版本(v2是新软件,v1是powerbuilder软件)。 V2 没有 V1 包含的所有功能,因此执行 V2 后,我必须执行 V1。所以如果用户在浏览器上使用V2,我应该能够打开V1(V2位于服务器中,V1安装在客户端中。因为客户端打开浏览器来连接到V2)。
*使用 google
desarrollé un software en ext.net(asp+c#) 进行翻译,该版本是 PowerBuilder 之前的其他软件的实际版本(分别为 llamaré v2 和 v1)。由于当时,软件 V2 与 V1 的功能没有任何关系,因此,V2 的程序将在 V1 中完成。 Vale decir, estando en el browser usando V2 debiera poder abrir V1 (.exe)
I have a application in ASP.NET / C# located on a server, my problem is how to run another application (.exe) but in the client that visit the website (the application on server)
question
(client)------------(server)
run browser website
and (asp.net/c#)
**execute instruction
app.exe** for execute app.exe
I developed ext.net, a soft using asp.net + c# which is an updated version of an old soft made in powerbuilder (v2 is the new soft, v1 is the powerbuilder one). V2 has not all the functionality included on V1, so after executing V2, I have to execute V1. so if the user is using V2 on the browser, I should be able to open V1 (V2 is located in a server, V1 installed in client. Since client opens browser to connect to V2).
*translated with google
desarrollé un software en ext.net(asp+c#) el cual es una version actualizada de otro software anterior hecho en PowerBuilder (los llamaré v2 y v1 respectivamente). Por razones de tiempo, el software V2 no tiene todas las funcionalidades de V1, por lo cual, al finalizar el procedimiento con V2 se debe abrir V1. Vale decir, estando en el browser usando V2 debiera poder abrir V1 (.exe)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
不幸的是,由于安全原因,这是不可能的。如果可能的话,黑客可能会对客户端计算机造成严重破坏。但是,您也许可以在旧版 IE 上使用 ActiveX。这可能需要将安全设置降低到最低限度。无论如何,链接如下:
http://www.governmentsecurity.org/forum/index .php?showtopic=23488
It is, unfortunately, not possible due to security reasons. Had it been possible, hackers could have created havoc on client machines. However, you may be able to, may be, on older IE version using ActiveX. This may require lowering the security setting to bare minimum. Here's the link any way:
http://www.governmentsecurity.org/forum/index.php?showtopic=23488
应用的目的是什么,点击一次或许就能解决。
http://msdn.microsoft.com/en -us/library/t71a733d(v=vs.80).aspx
事实上你不能直接从浏览器执行代码并不是不幸的事情,这是一个很好的安全性 特征。
What is the purpose of the application, click once may be a solution .
http://msdn.microsoft.com/en-us/library/t71a733d(v=vs.80).aspx
The fact you cannot execute code directly from a browser is no unfortunate thing, it is a wonderful security feature.
在这个方向上你唯一能做的就是提供一个指向应用程序的链接,以便用户可以决定单击它、下载文件并在本地执行它。
显然 Sys Internals 是这样做的,请检查此处: Windows SysInternals
但实际上他们的实时服务只是提供您可以访问此页面的链接:http://live.sysinternals.com/,然后您可以从中下载并本地执行。
the only thing you can do in this direction is give a link to the application so that the user can decide to click on it, download the file and execute it locally.
Apparently Sys Internals does this, check here: Windows SysInternals
but in fact their live service simply gives you the link to this page: http://live.sysinternals.com/ from where you can then download and execute locally.
我们需要有关您的 exe 需要执行的操作的更多详细信息,因为它将影响您使用的技术,但执行您想要执行的操作的正确方法是:
Microsoft 一体化代码框架 提供了 ActiveX 和 Silverlight 的示例。我建议尝试 一体化示例浏览器 它有点混乱边缘但它有效。 还有一个 VS2010 扩展,但它不适用于VS2010 的 Express 版本或 VS2008。
有关如何为网页设置 ActiveX 的简单示例,请参阅示例 HTMLEmbedActiveX 。我不知道具体的 silverlight 示例可以向您指出。
请在您的主要帖子中提供更多详细信息,说明您实际尝试在客户端执行的操作,我可以告诉您其中一种方法是否有效。
We need more details on what your exe needs to do as it will affect the technology you use but the correct way to do what you want to do is either:
The Microsoft All-In-One Code Framework has examples of both ActiveX and Silverlight. I reccomend trying the All-In-One Sample Browser it's a little ruff around the edges but it works. There is a VS2010 extension too but it does not work with the express version of VS2010 or with VS2008.
For a simple example on how to set up ActiveX for a web page see the example HTMLEmbedActiveX. I do not know a specific silverlight example to point you to.
Please provide more details in your main post of what you are actually trying to do on the client side and I can tell you if one of these methods will work.
@Scott Chamberlain:这就是我能够解释原始问题的方式:
我有一个在服务器上运行的 ASP.NET / C# 应用程序。我想要的是运行其他应用程序(.EXE),但是在访问有问题的服务器的客户端
问题
该应用程序是在 EXT.NET (ASP + C#) 中开发的,这是一个更新版本另一个在 PowerBuilder 中构建的旧应用程序。 (我们分别称它们为V2和v1)。
目前,V2 具有 V1 的所有功能,因此在程序结束时应打开 V1 和 V2。也就是说,在同时使用V1和V2的浏览器中应该能够在客户端上打开.EXE。
我无法完全理解最后一段
@Scott Chamberlain: This is how I have been able to interpret the original question:
I have an application in ASP.NET / C# running on a server. What I want is to run other application (.EXE), but on the client who visit the server in question
question
The application has been developed in EXT.NET (ASP + C#) which is an updated version of another old application built in PowerBuilder. (Lets call them V2 and v1 respectively).
For the time being, the V2 has all the features of V1, so at the end of the procedure should be opened V1 and V2. That is, in the browser using both V1 and V2 should be able to open .EXE on the client.
I could not understand the last paragraph completely
如果您将 V1 应用程序定义为 URL 处理程序,那么您可以从任何最新的 Web 浏览器调用它。无需 ActiveX!
这很完美。我将它用于从 Web 应用程序到正在运行的 PB win32 应用程序的应用程序到应用程序链接。我有一个单独的 PB win32 应用程序作为 URL 处理程序。 URL 处理程序查找正在运行的应用程序。如果它找到正在运行的应用程序,则会向该主应用程序发送一个事件。否则,它会启动主应用程序,将命令作为命令行参数从网站发送。效果完美!
If you define your V1 application as a URL handler then you can call it from any recent web browser. No need for ActiveX!
This works perfect. I use it for app-to-app links from web applications into a running PB win32 application. I have a separate PB win32 app acting as the URL handler. The URL handler looks for the running application. If it finds the running application it sends an event to that main application. It it doesn't it starts the main application sending the command from the web site as a commandline argument. Works perfect!