C# 在windows server 2003和ii6中从代码执行进程-权限错误
我在从测试服务器执行进程时遇到问题。在使用windows XP和iis5.1的本地主机上,我更改了machine.config文件,使其具有以下行- 然后,我将iis的登录名更改为以本地系统帐户登录,并允许服务器与桌面交互。这修复了我在xp中从代码执行进程的问题 在windows server 2003上使用相同的方法(使用iis6隔离模式)时,不会执行该进程 下面是执行该过程的代码(我已经通过命令行测试了iecapt的输入,并生成了一个图像)-C# 在windows server 2003和ii6中从代码执行进程-权限错误,c#,process,permissions,iis-6,windows-server-2003,C#,Process,Permissions,Iis 6,Windows Server 2003,我在从测试服务器执行进程时遇到问题。在使用windows XP和iis5.1的本地主机上,我更改了machine.config文件,使其具有以下行- 然后,我将iis的登录名更改为以本地系统帐户登录,并允许服务器与桌面交互。这修复了我在xp中从代码执行进程的问题 在windows server 2003上使用相同的方法(使用iis6隔离模式)时,不会执行该进程 下面是执行该过程的代码(我已经通过命令行测试了iecapt的输入,并生成了一个图像)- 默认情况下,IIS用户帐户具有拒绝权限。请尝试
默认情况下,IIS用户帐户具有拒绝权限。请尝试将其取下,并确保您拥有运行IIS应用程序池的帐户的写入权限。我相信这是网络服务帐户
public static void GenerateImageToDisk(string ieCaptPath, string url, string path, int delay)
{
url = FixUrl(url);
ieCaptPath = FixPath(ieCaptPath);
string arguments = @"--url=""{0}"" --out=""{1}"" --min-width=0 --delay={2}";
arguments = string.Format(arguments, url, path, delay);
ProcessStartInfo ieCaptProcessStartInfo = new ProcessStartInfo(ieCaptPath + "IECapt.exe");
ieCaptProcessStartInfo.RedirectStandardOutput = true;
ieCaptProcessStartInfo.WindowStyle = ProcessWindowStyle.Hidden;
ieCaptProcessStartInfo.UseShellExecute = false;
ieCaptProcessStartInfo.Arguments = arguments;
ieCaptProcessStartInfo.WorkingDirectory = ieCaptPath;
Process ieCaptProcess = Process.Start(ieCaptProcessStartInfo);
ieCaptProcess.WaitForExit(600000);
ieCaptProcess.Close();
}