using (C# リファレンス)using (C# Reference)
using
キーワードは、主に次の 3 つの場合に使用します。The using
keyword has three major uses:
- ステートメントの使用では、破棄されるオブジェクトの末尾でスコープを定義します。The using statement defines a scope at the end of which an object will be disposed.
- using ディレクティブでは、名前空間のエイリアスを作成したり、他の名前空間で定義されている型をインポートしたりします。The using directive creates an alias for a namespace or imports types defined in other namespaces.
- 静的ディレクティブの使用では、1 つのクラスのメンバーをインポートします。The using static directive imports the members of a single class.