| ||Input and Output Classes - slide 7 : 40|
The using control structure
The using control structure is helpful when we do IO programming
using (type variable = initializer)
- In the scope of using, bind variable to the value of initializer
- The type must implement the interface IDisposable
- Execute body with the established name binding
- At the end of body do variable.Dispose
- The Dispose methods in the subclasses of Stream call Close
The control structure 'using' defined by 'try-finally'.
The simple write-program programmed with 'using'.
The simple read-program programmed with 'using'.