process.start()在IIS服务器上不起作用 [英] process.start() not working on iis server

查看:333
本文介绍了process.start()在IIS服务器上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨.
我想打开一个存储在application文件夹旁边的html文件.此html文件是在运行应用程序时动态生成的.当我使用process.start(@filepath)打开文件时,它在我的PC上工作正常,但之后在iis服务器上进行配置时,它不会打开该html文件,因此建议我在服务器上运行应用程序时应打开文件该怎么办

hi.
i want to open a html file which is stored in side a folder of application.this html file is generated dynamically while running the application .when i m using process.start(@filepath)for opening the file it works fine on my pc but after configuring on iis server it wont open that html file so suggest me what should i do o open the file while running the application on server

推荐答案

对应用程序"(我猜这是一个Web应用程序),客户端/服务器基础结构以及实际发生的位置感到困惑.这不完全是您的错,因为ASP.net是混淆客户端/服务器边界并假装整件事是用户计算机上的独立应用程序的一项巨大活动.

但事实并非如此.您在后面的代码"中编写的任何代码都将在服务器上执行 ,并且任何外部副作用将仅在此处可见 –即用户坐在浏览器中将无法看到您尝试启动的任何消息框或进程. (让我们跳过一个事实,即对ASP.net脚本的权限甚至可能不允许这样的事实.)

如果您是根据Web应用程序上的请求而生成HTML文件的,为什么不在响应中包括该HTML内容,那么当用户执行此操作时,他们会看到吗?或者,如果它应该是可下载的文档(在这种情况下,它应该是PDF或类似文件,而不是HTML),那么您需要将其保存在可以访问其URL的某个位置,或者将其单独生成可以提供URL的脚本,并且浏览器要求该URL.
It seems like you are terminally confused about ''applications'' (I guess this is a web app), client/server infrastructure and where things actually happen. This isn''t entirely your fault as ASP.net is one giant exercise in obfuscating the client/server boundary and pretending that the whole thing is a standalone app on the user''s machine.

But it isn''t. Any code you write in your ''code behind'' will execute on the server, and any external side effects will only be visible there – i.e. the user sitting at their browser won''t be able to see any message boxes or processes you try to start. (Let''s skip over the fact that the permissions on an ASP.net script probably don''t even allow such things.)

If you generate a HTML file as a result of a request made on a web app, why not include that HTML content in the response, so when the user does whatever action this is, they see it? Or if it''s supposed to be a downloadable document (in which case it should be a PDF or similar, not HTML), then you need to stash it somewhere where it''s URL accessible, or have it generated in a separate script which you can provide a URL to, and have the browser request that URL.


IIS Express和开发服务器不是服务,它们在您的用户空间中运行.
1)作为交互用户,您可以创建交互过程,默认情况下不允许服务与桌面交互-谁会在没有人登录的服务器上看到该服务? IIS是一项服务.顺便说一下,在v6及更高版本的内核上,也存在会话0"隔离.
2)要从shell启动文档,您(操作系统)需要知道扩展名关联.由于这些是注册表中的用户级别设置,因此默认情况下,作为网络服务的技术用户不会拥有这些设置

打开文件是一回事,启动关联的应用程序是另一回事.那么您的目的是什么?
IIS Express and development server are not services, they run in your user space.
1) As interactive user, you can create interactive process, a service is not allowed by default to interact with the desktop - who would ever see it on a server, where nobody is logged on? And IIS is a service. By the way, on kernel v6 and above there is a "session 0" isolation also.
2) To start a document from shell, you (the os) need to know the extension associations. As these are user level settings in registry, a technical user as NETWORK SERVICE won''t have these settings by default

Opening a file is one thing, starting the associated application is an other. So what is your intention with it?


首先,在服务器上打开html文件有什么需要?没有用户会看到.
确切的要求是什么?
First of all, what is the need for opening html file on the server? none of the users are going to see that.
What is the exact requirement?


这篇关于process.start()在IIS服务器上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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