从asp.net执行exe [英] executing exe from asp.net

查看:121
本文介绍了从asp.net执行exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我已经创建了一个asp.net Web应用程序.

从我的Web应用程序中,我正在执行一个基于Windows的简单.exe文件(由我创建的.net应用程序).
它在我的本地PC上运行良好,但是当我通过(IIS)在客户端PC中配置该Web应用程序时,我的Web应用程序未执行该exe文件(由我创建).

这是我的代码

Hi all,

I have created an asp.net web application.

From my web application I am executing one simple windows based .exe file(.net application which is created by me).
It''s working well in my local PC, but when I configure that web application in client pc through(IIS), my web application is not executing that exe file (which is created by me).

This is my code

System.Diagnostics.Process myProces = new System.Diagnostics.Process();
       myProces.StartInfo.FileName = @"C:\\WindowsFormsApplication2.exe";
       myProces.Start();



请指导我解决此问题.



Please guide me to rectify this issue.

推荐答案

这是因为代码是在服务器而不是客户端上执行的.

您不能直接在客户端计算机上启动任何应用程序-被视为可能的病毒活动"并被正确阻止.

当您对其进行测试时,该应用程序正在执行,但是在服务器而不是客户端上执行.由于客户端和服务器是同一台PC,因此看起来好像可以正常工作.现在,您可能有一个非常烦躁的Web服务器管理员,他的服务器运行着几十个小应用程序...
That is because the code is executed at the server, not the client.

You cannot start any application directly on the client machine - that is counted as "probable virus activity" and rightly prevented.

When you tested it, the application was executing, but on the server rather than the client. It looked as if it worked because the client and the server were the same PC. Right now, you probably have a rather annoyed Webserver admin who has a server running a couple of dozen little applications...


您的应用程序是在服务器端执行的(您的ISS所在的PC位于)

如果您希望应用程序从客户端启动,建议您查看 ClickOnce [ ^ ].但是,如果您不了解Web应用程序中客户端和服务器端之间的区别,那么您应该适当地退后一步,从小做起.
Your application is executed on the server side (the PC your ISS is located at)

If you want the application to start on the client side I would suggest you look into ClickOnce[^]. But if you don''t understand the difference between client side and server side in a web application then you should properbly take a few steps back and start out small.


这篇关于从asp.net执行exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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