C# AccessViolationException error Memory Corrupt

作者开发了一个C#应用程序,该程序每秒读取文件并使用RichTextBox显示内容。但在运行几小时后出现AccessViolationException错误。更换为ListBox后问题解决,推测可能由于频繁刷新及内存损坏导致。
C# AccessViolationException error Memory Corrupt
2012年01月18日
  I made an application that read a file in every seconds and display the content of the file. then AccessViolationException error occurs when run this program a few hours . I didn't understand why this error keep occuring. every function is fine and it do their function so well. and it shows this error in Application.Run(), I searched so many answers in google and baidu, got nothing useful. I used RichTextBox to display the content of file. And used two threads to refresh the file contents and display the contents in the RichTextBox. But When I changed RichTextBox to ListBox to display the file content, then weird thing happen, this error never occurs. I am wondering that it caused by refreshing frequently and inserting data to RichTextBox and memory corrupted. I think this is the reason. If you have the same problems try to use ListBox or other Tools instead of RichTextBox .
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值