почему мы помещаем using перед streamreader в C #

почему мы используем before streamreader в c #

using (StreamReader sr = new StreamReader("TestFile.txt")) 
{
    string line;
    // Read and display lines from the file until the end of 
    // the file is reached.
    while ((line = sr.ReadLine()) != null) 
    {
        Console.WriteLine(line);
    }
}
6
задан Pranay Rana 4 May 2012 в 20:31
поделиться