帮我解决这个错误

帮我解决这个错误

问题描述:

如何处理ObjectDisposedException?

how to handle with ObjectDisposedException ?

在c#中你无法绑定一个Object。



如果CLR发现此对象不再可用,则从内存中释放。



如果你想要CLR不要处置你的对象。然后把它存放在静态var



就像



//



public static Form _F;



表格f =新表格();

_F = f;



现在这个对象永远不会被CLR处理,直到应用程序关闭
in c# you can not bound an Object.

if CLR find that this object is not longer usable it Disposed from the memory .

if you want CLR not Dispose your object . then store it in an static var

like

//

public static Form _F;

Form f=new Form();
_F=f;

now this object never Dispose by CLR until the application will close