Skip to content

Thinking more…

Just thinking more…

Posted on 2004/09/14 by elleryq

c# using

http://www.codeproject.com/csharp/TinguUsingStatement.asp
using 是一個可以確保物件會被 dispose 的 syntax,
當使用

using( aaa a=new aaa() )
{
a.doSomething();
}

實際上就等於是

aaa a=new aaa();
try
{
a.doSomething();
}
finally
{
if( a!=null )
((IDisposable)a).Dispose();
}

Categories.Net

Post navigation

Previous PostPrevious Ogawa
Next PostNext Defrag API C# wrappers
September 2004
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
27282930  
« Aug   Oct »

站內搜索

Categories

  • .Net
  • Android
  • Blog
  • Boo
  • C/C++
  • Cook
  • Linux 及其相關
  • Lyrics
  • Python
  • Visual FoxPro
  • Wine品嚐美酒
  • 亂亂逛
  • 個人新聞台
  • 理財
  • 資訊相關Idea與筆記
  • 雜記,隨筆
  • 電影流水帳
Privacy Policy Proudly powered by WordPress