以下代碼,用Using可避免一些問題,例如handel10000。
如果PaymentForm裏面用dialogresult=''而不是close或X,(close或X會即時dispose回收,但dialogresult不會)雖然說DOTNET會自動回收,但非常之不確定,特別是短時內不會回收,造成資料浪費。
用以下辦法比較好!
PaymentForm pf = null;
using ( pf = new PaymentForm(tempAmt, ref this.dataSet, ref this.dataSetOld, "cinv"))
{
}
}
//測試過pf會被回收!
//MessageBox.Show(pf.IsDisposed.ToString());

相关文章:

  • 2022-02-08
  • 2021-10-23
  • 2021-05-16
  • 2022-12-23
  • 2022-03-08
  • 2021-07-10
  • 2021-10-06
  • 2022-12-23
猜你喜欢
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2021-09-20
  • 2022-03-09
  • 2022-12-23
  • 2021-08-03
相关资源
相似解决方案