WPF WebBrowser 加载 html ,出现安全警告, 运行 脚本和 activeX 控件,


 

对于你的问题,只需要在你的HTML首行添加如下代码即可隐藏安全提示条:

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

 

还有一个可选方案是使用Winform的WebBrowser控件,不需要更改HTML代码,也不会出现安全提示,需要WindowsFormsHost:

xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded"> <Grid> <WindowsFormsHost> <wf:WebBrowser x:Name="webbrowser1"/> </WindowsFormsHost> </Grid>

 

可见: http://msdn.microsoft.com/en-us/library/ms751761(v=vs.110).aspx


We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. 
Click HERE to participate the survey.

 

https://social.msdn.microsoft.com/Forums/sqlserver/zh-CN/f070e94a-92b3-451f-a4af-7fa5265eb818/wpf-webbrowser-html-activex-?forum=wpfzhchs


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM