即使已经提供,也要启动要求凭据的进程

时间:2013-10-22 09:50:06

标签: c#

我使用以下代码创建了一个进程:

Process process = new Process();
// Configure the process using the StartInfo properties.
process.StartInfo.FileName = fileToRun;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.Arguments = arguments;
process.StartInfo.Domain = "domainName";
process.StartInfo.UserName = "username";
SecureString ss = new SecureString();
"password".ToCharArray().ToList().ForEach(ss.AppendChar);
process.StartInfo.Password = ss;
process.Start();
//Check if we need to wait for the process to exit
if (waitForExit)
{
    process.WaitForExit();
}

此过程的参数是http://位置,需要用户名和密码。即使我提供了用户名和密码,我仍然会获得凭据的Windows提示符。有什么事情我需要这样做,以至于它没有要求凭证吗?

0 个答案:

没有答案