[C#] Using 關鍵字的用法

C#有主要兩個用法:

  • 做為指示詞,此時它是用來建立命名空間的別名,或是用來匯入在其他命名空間中定義的型別。
  • 做為陳述式,此時它是用來定義一個範圍,物件會在此範圍結尾處進行處置 (Dispose)


相關教學資源請參考以下:

  1. using 陳述式 (C# 參考)
  2. C# Using Statement Calls Dispose
  3. using 指示詞 (C# 參考)
This entry was posted in C, 程式設計, 資工. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *