1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | using System; using System.IO; namespace FileHandling { public class FileHandling { static void Main(string[] Args) { StreamReader lStrReader; StreamWriter lStrWriter; string lLine = null; string lText = "Kevin David Mitnick is a computer\r\n" + "security consultant and author. In\r\n" + " the late 20th century, he was\r\n" + "convicted of various computer- and\r\n" + " communications-related crimes. At\r\n" + " the time of his arrest, he was\r\n" + "the most-wanted computer criminal\r\n" + "in the United States"; lStrWriter = new StreamWriter("Output.txt"); lStrWriter.WriteLine(lText); lStrWriter.Close(); lStrReader = new StreamReader("Output.txt"); while ((lLine = lStrReader.ReadLine()) != null) { Console.WriteLine(lLine); } } } } |