看板C_Sharp
标 题Re: [闲聊]看到使用C#开发ADO.NET的好处...{Tydhis}
发信站元智大学风之塔 (Sat Oct 2 03:47:22 2004)
转信站ptt!ctu-reader!ctu-peer!news.nctu!news.csie.ncyu!news.cs.nthu!newsfeed
※ 引述《luse (不管任何阻碍 ~~)》之铭言:
> - 43 -
> 凡有实作 IDispose
> 都可以用Using喔 XD
修正一下, 是 IDisposable
GC 只能管理 Component 所使用的 Memory
其它的像 Database handle, File handle, or P/Invoke 所使用的 Handle
都必须靠实作 IDisposable 来将其 handle 所占的 memory free 掉..
using (xx)
{
...
}
=
try
{
...
}
finally
{
xx.Dispose
}
--
※ Origin: 元智大学 风之塔 <bbs.yzu.edu.tw>
※ From : 220-139-136-22.dynamic.hinet.net
※ X-Info: Re: [闲聊]看到使用C#开发ADO.NET的好处...{Tydhis}
※ X-Sign: 10LRD2AY8AgwnHsl0p8s (04/10/02 3:47:22 )