System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) 拒绝访问 [英] Access is denied at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)

查看:36
本文介绍了System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) 拒绝访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试上传文件并将它们转换为另一种格式,然后再将它们保存到我的 Web 服务器上,但出现以下错误:System.ComponentModel.Win32Exception (0x80004005): System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start()

I am trying to upload files and convert them to another format before saving them on my web server, but I get the following error: System.ComponentModel.Win32Exception (0x80004005): Access is denied at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start()

当我尝试在本地计算机的 Web 服务器 (Windows 7) 上执行此操作时没有问题,但是在将我的网站部署到我的 Web 托管服务提供商(具有 Windows Server 2008 R2)后出现此错误.

There was no problem when I tried to do this on my local machine's web server (Windows 7), but I am getting this error after deploying my website to my web hosting provider, which has Windows Server 2008 R2.

我正在使用 ASP.NET c#.我猜这是一个权限问题,但我不确定如何提升任何权限.请帮忙!

I am using ASP.NET c#. I'm guessing it's a permissions issue, but I'm not sure how to elevate any permissions. Please help!

推荐答案

我怀疑您是否可以授予标准 ASPNET 用户执行程序的权限(这也是不好的做法).更好的选择(除了启动进程)是将​​应用程序池的用户更改为服务器上有权执行该进程的本地用户(最好是非管理员帐户).请注意,您启动的进程不能有任何 UI 组件,因为您不会看到它在运行.

I doubt you can give permissions to execute programs to the standard ASPNET user (and it would be bad practice as well). A better option (short of not starting a process) would be to change the user of the Application Pool to a local user on the server that has permissions to execute the process (preferable a non-admin account). Be aware that the process you start can't have any UI components since you won't see it running.

这篇关于System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) 拒绝访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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