Process.start不适用于IIS [英] Process.start is not working on IIS

查看:81
本文介绍了Process.start不适用于IIS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中,我通过文件上传控件将Excel工作表上传到共享文件夹,并在页面中显示Excel工作表的名称。点击名称后打开Excel工作表。但问题是工作正常当我在IIS中托管它时,它无法执行Process.start()。我正在使用Windows身份验证。请有人提供解决方案....

In my project I am uploading Excel sheets by a file upload control into a shared folder and displaying the name of the excel sheet in the page.After clicking on the name its opening the Excel sheet.But the problem is that its working fine in local system.when i am hosting it in IIS its not able to execute Process.start().I am using windows authentication.Please someone provide the solution....

推荐答案

你是一个来自Web应用程序的进程的字符串,这意味着你只能允许ASP.NET工作进程做什么!



You are string a process from within the web application, this means you can only do what the ASP.NET worker process is allowed to do!

MSDN:

ASP.NET网页和服务器控制代码在上下文中执行Web服务器上的ASP.NET辅助进程。如果在ASP.NET网页或服务器控件中使用Start方法,则新进程将在具有受限权限的Web服务器上执行。该过程不会在与客户端浏览器相同的上下文中启动,也无法访问用户桌面。

ASP.NET Web page and server control code executes in the context of the ASP.NET worker process on the Web server. If you use the Start method in an ASP.NET Web page or server control, the new process executes on the Web server with restricted permissions. The process does not start in the same context as the client browser, and does not have access to the user desktop.

[MSDN]参见文章 - Process.Start方法(ProcessStartInfo) [ ^ ]





----------- -------------------------------------------------- ----------------

分辨率:(有关无法从ASP.NET线程启动进程 [ ^ ]



这些是需要遵循的步骤,



1.授予ASP.NET工作进程帐户(< localmachine> \ ASPNET)与桌面交互或允许ASP.NET工作进程在SYSTEM帐户中运行的权限。



要知道如何允许工作进程在SYSTEM帐户中运行并了解ASPNET帐户的默认权限,请查看本文

INFO:ASP.NET中的进程和请求标识(http:// support。 microsoft.com/default.aspx?scid=kb;en-us;317012)



2.启用IIS Admin Service与桌面交互



要配置此功能,请按以下步骤操作。



a。打开控制面板,然后按照下列步骤操作:

对于Windows NT:单击服务。

对于Windows 2000,Windows XP和.NET Server:单击管理工具,然后单击服务。



b。双击IIS Admin Service。



c。在登录选项卡上,选中允许服务与桌面交互复选框。

注意:本文假定IIS Admin Service作为本地系统运行。



d。停止并重新启动IIS Admin Service。







干杯,

Edo

[MSDN] See article - Process.Start Method (ProcessStartInfo)[^]


-----------------------------------------------------------------------------
Resolution: (See more on Unable to Start a Process from ASP.NET Thread[^]

These are steps that needs to be followed,

1. Give permission for ASP.NET worker process account (<localmachine>\ASPNET) to interact with desktop or allow ASP.NET worker process to run in SYSTEM account.

To know how to allow worker process to run in SYSTEM account and to know the default permissions of ASPNET account, check this article
INFO: Process and Request Identity in ASP.NET (http://support.microsoft.com/default.aspx?scid=kb;en-us;317012)

2. Enable IIS Admin Service to interact with desktop

To configure this, follow this steps.

a. Open Control Panel and follow these steps:
For Windows NT: click Services.
For Windows 2000, Windows XP, and .NET Server: click Administrative Tools, and then click Services.

b. Double-click IIS Admin Service.

c. On the Log On tab, select the Allow Service to Interact with Desktop check box.
Note: This article assumes that the IIS Admin Service runs as a local system.

d. Stop and restart the IIS Admin Service.



Cheers,
Edo

网站如何运作?这实际上是基础:客户端请求网页,Web服务器将页面内容作为HTML文本发送给客户端;如果要在页面中嵌入图像/视频等,则在页面中使用一些由浏览器解释的特殊标签(在客户端!),然后浏览器从所指示的位置请求文件。这就是全部:只需在客户请求后将文本或文件从服务器传输到客户端。

所以:您希望Excel如何在这样的设置中工作?

如果IIS打开Excel,发生在服务器上。那个克林特怎么看?不,它不能。没办法这样做。

返回开始:构建一个简单的静态网页。然后让应用程序创建页面的HTML。然后转到更复杂的场景。然后你会明白你的想法是行不通的。
How does a web site work? That's actually basics: a client requests a web page, and the web server sends the page's contents as HTML text to the client; if an image / video etc is to be embedded in the page, some special tags are used in the page which are interpreted by the browser (on client side!), and the browser requests then the files from the locations indicated. That's all: just transfer of text or files from server to client after client request.
So: how do you expect Excel to work in such a setting?
If IIS opens Excel, that happens on the server. And how can the cleint see that? No, it cannot. No way to do so.
Return to start: build a simple static web page. Then have an application create the HTML of the pages. And then go to more complicated scenarios. Then you'll understand that your idea cannot work.


这篇关于Process.start不适用于IIS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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