C# AccessViolationException error Memory Corrupt


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 .  

猜你喜欢

转载自jkggd41g.iteye.com/blog/1359347