System.Diagnostics.Process.Start 不能从 IIS 工作 [英] System.Diagnostics.Process.Start not work from an IIS

查看:38
本文介绍了System.Diagnostics.Process.Start 不能从 IIS 工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从控制台应用程序运行 System.Diagnostics.Process.Start 时它可以工作,但是当我从 IIS 中托管的 Web 服务运行时相同的代码不起作用.

When I run System.Diagnostics.Process.Start from my console application it works but the same code when I run from my web service hosted in IIS doesn't work.

是否与 ASP.Net 权限有关??如果是,我如何从我的 C# 代码配置它.

Is it some thing to do with ASP.Net privileges?? if yes how can I configure it from my C# code.

推荐答案

ASP.NET 网页和服务器控制代码在 Web 服务器上的 ASP.NET 工作进程的上下文中执行.如果您在 ASP.NET 网页或服务器控件中使用 Start 方法,则新进程将在具有受限权限的 Web 服务器上执行.该进程不会在与客户端浏览器相同的上下文中启动,并且无法访问用户桌面.http://msdn.microsoft.com/en-us/library/0w4h05yb.aspx

与桌面交互或允许 ASP.NET 工作进程在系统帐户中运行.

to interact with desktop or allow ASP.NET worker process to run in SYSTEM account.

要进行配置,请按照以下步骤操作.

To configure this, follow this steps.

  • 一个.打开控制面板并按照以下步骤操作:对于 Windows NT:单击服务.对于 Windows 2000、Windows XP 和 .NET Server:单击管理工具,然后单击服务.

  • 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.双击 IIS 管理服务.

b. Double-click IIS Admin Service.

这篇关于System.Diagnostics.Process.Start 不能从 IIS 工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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