Foxtable(狐表)用户栏目专家坐堂 → WebBrowser内存问题


  共有2404人关注过本帖树形打印复制链接

主题:WebBrowser内存问题

帅哥哟,离线,有人找我吗?
ycli368
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:993 积分:10398 威望:0 精华:0 注册:2012/12/11 14:25:00
WebBrowser内存问题  发帖心情 Post By:2015/10/26 16:50:00 [只看该作者]

Dim web As New system.windows.forms.WebBrowser
web.ScriptErrorsSuppressed = True

能在使用过程中释放内存吗
有关调用实时(JIT)调试而不是此对话框的详细信息,
请参见此消息的结尾。

************** 异常文本 **************
System.ComponentModel.Win32Exception: 存储空间不足,无法处理此命令。
   在 System.Drawing.BufferedGraphicsContext.CreateCompatibleDIB(IntPtr hdc, IntPtr hpal, Int32 ulWidth, Int32 ulHeight, IntPtr& ppvBits)
   在 System.Drawing.BufferedGraphicsContext.CreateBuffer(IntPtr src, Int32 offsetX, Int32 offsetY, Int32 width, Int32 height)
   在 System.Drawing.BufferedGraphicsContext.AllocBuffer(Graphics targetGraphics, IntPtr targetDC, Rectangle targetRectangle)
   在 System.Drawing.BufferedGraphicsContext.AllocBufferInTempManager(Graphics targetGraphics, IntPtr targetDC, Rectangle targetRectangle)
   在 System.Drawing.BufferedGraphicsContext.Allocate(IntPtr targetDC, Rectangle targetRectangle)
   在 System.Windows.Forms.Control.WmPaint(Message& m)
   在 System.Windows.Forms.Control.WndProc(Message& m)
   在 C1.Win.C1FlexGrid.Util.BaseControls.ScrollableControl.WndProc(Message& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/10/26 16:59:00 [只看该作者]

什么情况下报错的?只要执行了上面的代码就报错?

 

你肯定new了很多次对象吧?每次用完,要把其消除。如

 

web.Dispose


 回到顶部
帅哥哟,离线,有人找我吗?
ycli368
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:993 积分:10398 威望:0 精华:0 注册:2012/12/11 14:25:00
  发帖心情 Post By:2015/10/26 17:00:00 [只看该作者]

new了一次,循环打开几十个页面

 回到顶部
帅哥哟,离线,有人找我吗?
ycli368
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:993 积分:10398 威望:0 精华:0 注册:2012/12/11 14:25:00
  发帖心情 Post By:2015/10/26 17:01:00 [只看该作者]

能处理完完关闭连接不,Native的链接用完关掉是不是就释放了

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/10/26 17:54:00 [只看该作者]

你肯定是循环new了,用完要释放掉。

 

做例子来测试。


 回到顶部