首页 新闻 赞助 找找看

System.OutOfMemoryException: 引发类型为“System.OutOfMemoryException”的异常

0
[已解决问题] 解决于 2012-05-23 12:44

************** 异常文本 **************
System.OutOfMemoryException: 引发类型为“System.OutOfMemoryException”的异常。
   在 System.Windows.Forms.UnsafeNativeMethods.GetWindowText(HandleRef hWnd, StringBuilder lpString, Int32 nMaxCount)
   在 System.Windows.Forms.Control.get_WindowText()
   在 System.Windows.Forms.TextBoxBase.get_WindowText()
   在 System.Windows.Forms.TextBoxBase.ScrollToCaret()
   在 MasDB.Form1.SetRichText(RichTextBox r, String text)
   在 MasDB.Form1.SetText(String text, Int32 msgid)
   在 MasDB.Form1.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)


************** 已加载的程序集 **************
mscorlib
    程序集版本: 2.0.0.0
    Win32 版本:
    基本代码: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
MasDBMobile
    程序集版本: 1.0.0.0
    Win32 版本: 1.0.0.0
    基本代码: file:///D:/浙江移动通道/MasDBMobile.exe
----------------------------------------
System.Windows.Forms
    程序集版本: 2.0.0.0
    Win32 版本:
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    程序集版本: 2.0.0.0
    Win32 版本:
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    程序集版本: 2.0.0.0
    Win32 版本:
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
MySql.Data
    程序集版本: 5.0.8.1
    Win32 版本: 5.0.8.1
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/MySql.Data/5.0.8.1__c5687fc88969c44d/MySql.Data.dll
----------------------------------------
System.Data
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
    基本代码: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Transactions
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
    基本代码: file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
    基本代码: file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
System.Data.resources
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Data.resources/2.0.0.0_zh-CHS_b77a5c561934e089/System.Data.resources.dll
----------------------------------------
mscorlib.resources
    程序集版本: 2.0.0.0
    Win32 版本:
    基本代码: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
System.Windows.Forms.resources
    程序集版本: 2.0.0.0
    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
    基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_zh-CHS_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------

************** JIT 调试 **************
要启用实时(JIT)调试,
该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置
jitDebugging 值。
编译应用程序时还必须启用
调试。

例如:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

启用 JIT 调试后,任何无法处理的异常
都将被发送到在此计算机上注册的 JIT 调试器,
而不是由此对话框处理。

悟翼的主页 悟翼 | 菜鸟二级 | 园豆:202
提问于:2012-05-16 09:38
< >
分享
最佳答案
0

texbox长度有限制,32还是64K的,估计你的内容太多了吧

可以使用RichTextBox

奖励园豆:5
2012 | 高人七级 |园豆:21228 | 2012-05-16 13:11

确实是内容太多,当前使用的就是RichTextBox,但是不知道该怎么处理,请大牛支招!!!

悟翼 | 园豆:202 (菜鸟二级) | 2012-05-16 14:01

@悟翼: 这是框架的一个BUG, 参考http://social.msdn.microsoft.com/Forums/en/winforms/thread/8103b97a-ad61-486a-bad1-248c4c89cf0f 换一种加载的方法看看

不过即使正确了,很大的文件滚动什么的也很差

应该考虑换一个合适的其他控件,或者部分显示

2012 | 园豆:21228 (高人七级) | 2012-05-16 18:38
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册