摘要:
WinForm 单例publicstaticChatFormnewForm=null;publicstaticChatFormGetInstance(){if(newForm==null||newForm.IsDisposed==true)//newForm.IsDisposed==true必需,否则会出现“访问已释放资源”的异常{newForm=newChatForm();}else{newForm.Activate();}returnnewForm;}//调用:ChatFormnewForm=ChatForm.GetInstance();newForm.Ipcon=Ip;newForm.S 阅读全文