Wednesday, January 22, 2014

2 usings

This is a valid statement in C#
using(StreamWriter sw = new StreamWriter(@"c:\temp\b.txt"))
            using (StreamReader sr = new StreamReader(@"c:\temp\a.txt"))
            {
                sw.Write(sr.ReadToEnd());
            }


No comments:

Post a Comment