Is there any Using.System command or anything else, to close the automatically StreamReader.
I've been closing the StreamReader like this e.g.:
sr.Close();
Is there any Using.System command or anything else, to close the automatically StreamReader.
I've been closing the StreamReader like this e.g.:
sr.Close();
If you implement a using statement the streamreader will be disposed automatically.
using (StreamReader r = new StreamReader("file.txt"))
{
allFileText = r.ReadToEnd();
}