asp.net:无法从IIS上托管的网站打开exe应用程序 [英] asp.net : unable to open an exe application from website which is hosted on IIS

查看:55
本文介绍了asp.net:无法从IIS上托管的网站打开exe应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我在我的网络应用程序中添加了以下代码

Hello i have added following code in my web application

protected void Page_Load(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start("Notepad.exe");
        }





作为一个例子我使用的是notepad.exe,实际上我想要从网页打开任何exe。



这个应用程序在Visual Studio中正常工作,但当我在IIS上托管这个exe时,exe没有打开请帮助,因为我已经尝试了谷歌上的每个链接



i需要实现此功能请建议实现它的方法



as an example i am using notepad.exe , actually i want any exe to open from webpage.

this application works correctly in visual studio but when i am hosting this on IIS the exe doesnt open please help as i have tried every link possible on google

i need to implement this functionality please suggest ways to achieve it

推荐答案

Web代码在服务器上运行。因此,您拥有的代码将尝试在服务器上启动NotePad。它在开发过程中有效,因为您的机器是服务器。我认为你需要重新思考你想用网络代码完成的工作。
Web code runs on the server. So, the code you have will attempt to launch NotePad on the server. It works when you do it in development because your machine is the server. I think you need to rethink what you are trying to accomplish with web code.


你必须回去学习网络应用程序...

Web - 就其性质而言 - 是一个断开连接的应用程序,其中应用程序的两个部分以独占方式存在和活动...

这意味着当服务器激活客户端时,客户端不活动服务器不...

这里提供的代码属于服务器部分,为此它打开服务器上的notepad.exe!即使你有适当的权利(可以给它)记事本会在服务器上打开,没有人看!

按照以下步骤:

1.学习并了解网络应用程序的性质

2.关注客户端安全限制(无法删除这些限制)

3.确定网页的功能和找到解决方案
You have to go back and learn about web applications...
Web - by its nature - is a disconnected application, where the two parts of the application exists and active in an exclusive way...
It means that when the server active the client not and when the client active the server not...
The code you presented here belongs to the server part, and for that it opens the notepad.exe on the server!!! Even you had the proper rights (it is possible to give it) notepad would open on the server, where no one looks at!
Follow these steps:
1. Learn and understand the nature of a web application
2. Focus on client side security restrictions (those restrictions can not be removed)
3. Identify the functionality of your web page and find a solution


这篇关于asp.net:无法从IIS上托管的网站打开exe应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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