As for the question, the using keyword creates an object within the specified scope that will be disposed at the end of the block. Disposing objects is how managed code releases resources so it should always be done as soon as possible, which means as soon as you are finished using that object. Not all objects can be disposed because not all objects hold resources that need to be released. Generally speaking, any object that does will implement the IDisposable interface 和 any such object should have its Dispose or, if it has one, Close method called when the object is no longer required. The using block will implicitly call that method at the end of the block. If you need to create an object in one method 和 then use it in another then a using block is not an option but anything that is created 和 used only within a narrow scope should be created that way. If in doubt, read the documentation for a type 和 that will tell you whether it implements the IDisposable interface or you can just create a using block 和 the compiler will tell you if it's not valid.