views:

241

answers:

1

Using the Microsoft .NET WebBrowser control sometimes leads to a White Screen. Yahoo.com is a great example of a website that does that depending on your IE settings. I have found that by changing the Internet Options in Internet Explorer, those same settings will affect the WebBrowser object as well and make it possible for the WebBrowser object to "see" Yahoo properly.

My question is, how would one write code to change the settings of Internet Explorer temporarily and then change them back after? I realize there are all kinds of security concerns at play here. I just have not found a way to change the settings for just the WebBrowser object instance. Only when I change the Security UP TO High globally does it work. I might also be interested in toggling the Enable Protected Mode bit globally if possible as well.

I don't care if this triggers a Security alert in Vista. I mean obviously the user is going to have to clear the program for admin access to these types of settings.

Thanks!

-Chris.

+1  A: 

Changing IE security settings isn't the right way to go; among other things, OneCare, the security center, and other things will complain, and the user will be at risk.

Instead, what you want to do is implement an IInternetSecurityManager and tell your web browser control to use the security manager you've implemented. Your ProcessURLAction function will be called for every security decision, and you can return whatever result (Enable/Disable/Prompt) is most suitable for your application.

EricLaw -MSFT-