System.diagnostics.process.sta ... [英] System.diagnostics.process.sta...

查看:59
本文介绍了System.diagnostics.process.sta ...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用

System.Diagnostics.Process.Start()

在网站上打开服务器中的记事本文件在Visual Studio中进行调试时工作正常。但是当我在IIS中发布相同的应用程序并尝试打开时,它无法正常工作。



帮我解决这个问题!!!



我的尝试:



将应用程序池标识更改为本地系统,但无法正常工作..

It's working fine while debugging in visual studio. But when i published the same app in IIS and tried to open, it's not working.

Help me to fix this issue!!!

What I have tried:

Changed application pool identity to local system, but not working..

推荐答案

IIS作为服务器上的服务运行。它在会话0中运行,该会话与用户会话隔离。它没有连接屏幕。

即使在服务器上启动记事本进程,您的Web应用程序的任何用户都无法看到它。
IIS is running as a service on the server. It runs in "Session 0" which is isolated from user sessions. It does not have a screen connected to it.
Even when the notepad process gets started on the server, no user of your web application will be able to see that.


您的.net代码在服务器,因此记事本在服务器上打开,它只能在本地计算机上工作,因为您的本地计算机既是服务器又是客户端,但是一旦部署到远程服务器,记事本仍然在那里运行,但因为您不再是该计算机的客户端你没有看到它。



你不能在客户端机器上产生EXE,如果可能的话,这将是一个巨大的安全风险。
Your .net code runs on the server so the notepad opens on the server, it only worked on your local machine as your local machine was both server and client but once you deploy to a remote server the notepad still runs on there but as you are no longer the client of that machine you don't see it.

You can't spawn EXEs on the client machine, it would be a massive security risk if you could.


这篇关于System.diagnostics.process.sta ...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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