views:

556

answers:

1

Hi
I am using WPF C# WebBrowser control to navigate a local html file which contains js and css file links, so when my application navigates that local file I get an unwanted security warning information bar, can anyone suggest how to turn it off using C#? I know that I can turn it off in IE settings,and can use frame, but I don't want to use frame because I want to have access to HTMLElements. any suggestions?

+1  A: 

If it's your file to write and you trust its contents, adding the "mark of the web" silences the security messages. Just add the following line at the top of the html file:

<!-- saved from url=(0014)about:internet -->

Note that while the warnings are muted, security isn't compromised -- the page gets to render under IE's Internet security zone rather than get access to local resources.

Oren Trutner
Thanks a lot! It's really works
ArsenMkrt