使用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

 

 

posted @ 2011-12-27 01:58 海边的风 阅读(19) 评论(0) 编辑
摘要: 由于微软Webbrowser控件的限制,使用Webbrowser.Document.Cookie是不能获取到HttpOnly的cookie的。采用扩展的csExWB Webbrowser控件,就可以获取到HttpOnly的Cookie阅读全文
posted @ 2011-10-31 01:11 海边的风 阅读(205) 评论(1) 编辑

用IIS作为FTP服务器的时候,使用默认设置每次连接都会提示 “220-Microsoft FTP Service”,如果想禁用这个提示,可以用如下办法来解决:

 

    1. At a command prompt, change the location to the %systemroot%/inetpub/AdminScripts folder.
    2. At the command prompt, type cscript adsutil.vbs enum msftpsvc, and then press ENTER.
    3. At the command prompt, type cscript adsutil set msftpsvc/number/SuppressDefaultFTPBanner 1 (where number is the number of the FTP service where you want to disable the default FTP banner), and then press ENTER.

    Note If you have multiple FTP virtual servers, run this command for each virtual FTP server that has a different value for number. When you type the command, do not include a space between msftpsvc/ and number.
    4. At the command prompt, run the following command to restart the IIS service:
    iisreset

 

 

 来源:http://support.microsoft.com/kb/826270

 

 

posted @ 2011-10-16 13:46 海边的风 阅读(18) 评论(0) 编辑
摘要: 最近需要对一些数据加密后进行HTTP传输,由于希望对方只能收到数据后解密,而无法知道加密办法以防止伪造,所以选择了一个通过BigInteger类,使用私钥加密,公钥解密的算法。但这个算法在某些情况下会导致解密后数据出现乱码,解密失败的情况,通过分析找到了解决办法,与大家分享。阅读全文
posted @ 2011-06-03 10:55 海边的风 阅读(1754) 评论(12) 编辑

代码:

public class SingletonPerRequest
{
    
public static SingletonPerRequest Current
    {
        
get
        {
            
return (HttpContext.Current.Items["SingletonPerRequest"??
                (HttpContext.Current.Items[
"SingletonPerRequest"= 
                
new SingletonPerRequest())) as SingletonPerRequest;

        }
    }
}

 

 

详见:http://dotnetslackers.com/community/blogs/simoneb/archive/2006/08/21/The-ASP.NET-Singleton_2D00_per_2D00_Request-pattern.aspx

 

 

 

posted @ 2011-04-27 09:05 海边的风 阅读(90) 评论(0) 编辑
摘要: Windows7在运行一些软件的时候,比如Dreamweaver CS5,Fireworks CS5,经常出现无响应,原以为是软件的问题,实际上是Windows7上Direct2D和Direct3D的bug,安装补丁KB2488113后解决此bug对Creamwaver CS5的影响特别大,经常无响应,几乎达到很难正常使用的程度。此补丁是可选更新,默认情况下不会安装。KB链接http://support.microsoft.com/kb/2488113阅读全文
posted @ 2011-03-08 09:35 海边的风 阅读(729) 评论(0) 编辑
摘要: 具体表现为:使用OpenFileDialog或SaveFileDialog切换了文件夹以后,这个文件夹不能被删除,除非程序退出。解决的办法是:将OpenFileDialog或SaveFileDialog的RestoreDirectory设置为true。相关链接:http://bytes.com/groups/net-vb/506910-openfiledialog-handle-leak阅读全文
posted @ 2009-04-12 19:03 海边的风 阅读(307) 评论(0) 编辑
摘要: 网页上明明是引用的jpg或者gif图片,用ie另存为的时候却只能保存为bmp格式,通常的解决办法都是清空浏览器缓存,将ie浏览器缓存增大这两个方法,如果这两个方法都没用的话,很有可能是因为服务器端加了cache-control:nocache这个http头。如果web服务器上加了cache-control:nocache这个http头的话,因为ie最终都是把所有jpg图片还原成bmp来渲染,加了n...阅读全文
posted @ 2009-04-11 00:42 海边的风 阅读(255) 评论(0) 编辑
摘要: 安装阿里旺旺2008后,会修改IE浏览器的User-Agent为 Compatible-EmbeddedWB 14.59 http://bsalsa.com/ EmbeddedWB- 14.59 from: http://bsalsa.com/ ; 这会导致IE Webcontrols在客户端输出非正常的html代码,IE Webcontrols的TreeView等功能无法正常使用。解决办法:删除...阅读全文
posted @ 2009-04-06 23:38 海边的风 阅读(289) 评论(0) 编辑
摘要: MSBuild支持自定义编译条件,通过查看条件编译在proj文件中的定义,我们可以在MSBuild的参数中定义编译条件。如下:[代码]最后的这个 DefineConstants就是用来定义编译条件的。阅读全文
posted @ 2009-03-11 16:05 海边的风 阅读(179) 评论(0) 编辑