如何在我的网页上运行Exe文件 [英] How To I Run A Exe File On My Webpage

查看:610
本文介绍了如何在我的网页上运行Exe文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在网站上运行exe文件。它必须在我的网站打开时运行

I want to run a exe file on website . it must be run when my website is opened

推荐答案

你没有。



这是非常困难的有很好的理由:首先是安全。如果你能做到,那么恶意网站也是如此。其次,并非所有可以查看您网站的设备都可以执行EXE文件:它们可能是Android或iOS手机,Raspberry Pi设备或支持互联网的冰箱!



这不是说这是不可能的 - 但它在99.9999%的情况下。例外情况是您可以使用ActiveX控件来运行exe。但是......他们只使用IE(由于安全问题,其他浏览器都没有愚蠢到实现它们),必须启用它们(因为默认情况下它们被禁用的安全问题)并且用户必须给予权限为了它运行(因为安全问题,很少有用户再说是,谢天谢地)。



如果我是你,我会放弃这个想法。
You don't.

It's very difficult for very good reasons: Firstly security. If you can do it, then so can malicious websites. Secondly, not all devices that can view your website can execute EXE files: they may be Android or iOS phones, Raspberry Pi devices, or internet enabled fridges!

That's not to say it's impossible - but it is in 99.9999% of situations. The exception being when you can use an ActiveX control to run the exe. But...they only work with IE (because of the security problems none of the other browsers were stupid enough to implement them), they must be enabled (because of the security problems they are disabled by default) and the user must give permission for it to run (because of the security problems very few users say "yes" any more, thankfully).

I'd drop the idea, if I was you.


您无法在您的网站上运行.exe文件。但是,您可以将该文件传输到客户端,但会弹出一个安全问题,让用户知道您将可执行文件传递给计算机,这可能会对系统造成严重破坏。



不知何故,HTML中有一个可以托管java应用程序的applet。因此,您可以在您的网站中运行该Java应用程序,但.exe文件不可运行。



但是,如果您想在服务器上执行命令,或者在网站上的任何事件上运行服务器内的进程,您将使用



You cannot run an .exe file on your website. You can however, stream that file down to the client but a security issue would pop up letting the user know that you're passing an executable file to the computer which might cause a havoc in the system.

Somehow, there is an applet in HTML that can host a java application in it. So, you can run that Java application in your website, but .exe file is not runnable.

But, if you wanted to execute a command on the server, or run a process inside your server on any event on the website, you would use the

// inside handling the event, 
System.Diagnostics.Process.Start("fileName.exe");
// runs on the server, not on the client





但我相信,您可以将参数传递给您的应用程序,在那里执行,并将您尝试向用户显示的结果带回来。如果你不得不在客户端上执行,那么在客户端上执行的可能性也非常低,因为客户端可能在他们的末端有可执行文件。



这仍然不是不可能的,并且只有当知道可执行计算机上的可执行文件的位置时才能在用户端执行。例如,根据此回答 [ ^ ] SO,此代码为ActiveX





But I believe, you can pass down the parameters to your application, execute it there, and bring back the results you're trying to show to the user. This is also of a very low chances to execute on the client if you have had to execute on client, because clients might not have that executable on their end.

It is still not impossible, and can be executed on the user's end if and only if know the location of the executable on the cline't computer. For example, according to this answer[^] of SO, this code of ActiveX

<a href="javascript:LaunchApp()">Launch the executable</a>

<script>
function LaunchApp() {
if (!document.all) {
  alert ("Available only with Internet Explorer.");
  return;
}
var ws = new ActiveXObject("WScript.Shell");
ws.Exec("C:\\Windows\\notepad.exe");
}
</script>





将运行您传递的应用程序。



would run that application you pass.


检查这些链接。



http://forums.asp.net/t/1103055.aspx?how+to+run+a+exe+file+in+a+web + +应用程序 [ ^ ]



http://stackoverflow.com/questions/1039297/asp-net-running-an-exe-file [ ^ ]



http:// dotnetslackers .COM /社区/博客/海赛姆/存档/ 2007/02/02 /运行可执行-FIL e-in-ASP.NET.aspx [ ^ ]
Check these links .

http://forums.asp.net/t/1103055.aspx?how+to+run+a+exe+file+in+a+web+application[^]

http://stackoverflow.com/questions/1039297/asp-net-running-an-exe-file[^]

http://dotnetslackers.com/community/blogs/haissam/archive/2007/02/02/Run-Executable-file-in-ASP.NET.aspx[^]


这篇关于如何在我的网页上运行Exe文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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