使用的Process.Start Firefox的开始:当您设置USENAME和密码的Firefox无法启动 [英] Starting Firefox using Process.Start: Firefox not starting when you set Usename and Password
问题描述
当我尝试使用Process.Start和ProcessStartInfo(.NET)启动Firefox时,一切似乎都很好。但是当我指定另一个帐户(用户的成员)的用户名和密码,似乎没有发生。相同的代码适用于Calc.exe或IE。这是奇怪的。任何想法?
When I try to start Firefox using Process.Start and ProcessStartInfo (.NET) everything seems to work fine. But when I specify a username and password of another account (a member of Users), nothing seems to happen. The same code works fine with Calc.exe or IE. This is weird. Any ideas?
以下是代码:
System.Diagnostics.ProcessStartInfo pInfo = new System.Diagnostics.ProcessStartInfo();
pInfo.CreateNoWindow = false;
pInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
pInfo.WorkingDirectory = "{WorkingDirectory}";
pInfo.Arguments = "{CommandLineArgs}";
pInfo.FileName = "{ExecutableAddress}";
pInfo.ErrorDialog = true;
pInfo.UseShellExecute = false;
pInfo.UserName = "{LimitedAccountUserName}";
pInfo.Password = "{SecureLimitedAccountPassword}";
System.Diagnostics.Process.Start(pInfo);
感谢大家。
推荐答案
为了加载具有不同凭证的应用程序,如果应用程序使用用户配置文件,ProcessStartInfo的LoadUserProfile属性应设置为true。
In order to load an application with a different credential, if that app uses the user profile, LoadUserProfile property of the ProcessStartInfo should be set to true.
这篇关于使用的Process.Start Firefox的开始:当您设置USENAME和密码的Firefox无法启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!