我正在开发一个 ASP.net 应用程序,我正在尝试使用 System.Diagnostics.Process 类远程执行一个进程
这是我的代码:
ProcessStartInfo startInfo = new ProcessStartInfo(@"C:\TestCommand.exe");
startInfo.Domain = "myDomain";
startInfo.UserName = "MyUserName";
SecureString sec = new SecureString();
foreach (char item in "MyPassword")
{
sec.AppendChar(item);
}
sec.MakeReadOnly();
startInfo.Password = sec;
startInfo.UseShellExecute = false;
Process.Start(startInfo);
我不断收到异常消息“登录失败:未知用户名或密码错误”。我绝对确定我提交的是正确的用户名/密码
我在这里错过了什么吗?
Tks