You want to check the documentation for using statement (instead of using using directive, which refers to namespaces).
This basically means that the block is converted to the try/ block finally, and sw.Dispose()is called in the finally block (with a suitable invalidation check).
using , IDisposable - , .
:
:
using (Stream input = File.OpenRead("input.txt"),
output = File.OpenWrite("output.txt"))
{
}
:
using (padlock.Acquire())
{
}
;
using (TextReader reader = File.OpenText("input.txt"))
using (TextWriter writer = File.CreateText("output.txt"))
{
}