2012-04-04 54 views
0

从我们的测试服务器执行进程时出现问题。使用Windows XP和IIS5.1我的本地主机,我改变了machine.config文件有行 -在代码中执行windows server 2003和ii6中的进程 - 权限错误

我再改登录IIS以登录本地系统帐户,并允许服务器进行交互桌面。这解决了我在执行xp代码的过程中遇到的问题。

当在windows server 2003上使用相同的方法(使用iis6隔离模式)时,该进程不会被执行。

这里是执行过程中的代码(我已经测试的输入通过命令行到iecapt并产生图像) -

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(); 
    } 

回答

0

默认情况下,IIS用户帐户具有否认特权。尝试将它们关闭,并确保您具有IIS正在运行应用程序池的帐户的写入权限。我相信这是网络服务帐户。

相关问题