现在的位置: 首页 > 综合 > 正文

csExWB Webbrowser禁止flash内容的显示

2012年08月04日 ⁄ 综合 ⁄ 共 760字 ⁄ 字号 评论关闭
使用csExWB Webbrowser控件的Winform程序遇到崩溃问题,错误是:System.AccessViolationException: 尝试读取或写入受保护的内存。这通常指示其他内存已损坏。

 

经过排查,发现当csExWB控件显示特定的flash内容时,就会出现这种崩溃现象,也不知道是csExWB的问题,还是flash player的问题,只好禁止flash的显示了。

 

方法不再赘述,贴代码吧

 

private void cEXWB1_ProcessUrlAction(object sender, csExWB.ProcessUrlActionEventArgs e)
        {
            if (e.urlAction == IfacesEnumsStructsClasses.URLACTION.ACTIVEX_RUN)
            {
                Guid flash = new Guid("D27CDB6E-AE6D-11cf-96B8-444553540000");
                if (e.context == flash)
                {
                    e.handled = true;
                    e.urlPolicy = IfacesEnumsStructsClasses.URLPOLICY.DISALLOW;
                }
            }
        }

来源:

http://webknowledge.googlecode.com/svn/trunk/csExWB/csExWB/DemoApp/frmMain.cs

 

 

抱歉!评论已关闭.