使用WPF WebBrowser作为当前登录用户以外的其他用户运行应用程序-某些网页无法正常工作

时间:2018-10-24 07:11:27

标签: c# wpf webbrowser-control multi-user

我正在尝试以当前登录用户以外的其他用户身份运行WPF WebBrowser(使用Powershell Start-Process -FilePath "app.exe" -Credentials xxx。不幸的是,某些网站无法正常运行,例如Microsoft支持页面-https://support.microsoft.com/en-us/help/923196/you-receive-an-error-message-that-states-that-you-do-not-have-the-most。 问题是,这些页面没有完全加载-我遇到了"Script Error""An internal error occurred in Microsoft Internet Extensions"例外,并且页面仍然空白(仅加载了部分网站源代码)。有人知道发生了什么吗?是否有什么应该在WebBrowser中配置的,以便在其他用户处运行?

复制步骤:

1) Create simple WPF app and add WebBrowser control to it.    
2) Run app using "Start-Process" using powershell or "runas" using cmd as other 
user than currently logged in and navigate to
https://support.microsoft.com/en-us/help/923196/you-receive-an-error-message-that-states-that-you-do-not-have-the-most    
3) Issue occured

关于, Hawex

1 个答案:

答案 0 :(得分:0)

我发现,解决此问题的方法很简单-只需在-LoadUserProfilepowershell的{​​{1}}中添加/noprofile自变量。