using System;
using System.IO;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string path = @"d:\test.txt";
try
{
using (StreamWriter sw = new StreamWriter(path))
{
sw.WriteLine("C#");
sw.WriteLine("Programming");
sw.WriteLine("Is Good For Business");
}
using (StreamReader sr = new StreamReader(path))
{
while (sr.Peek() > -1)
Console.WriteLine(sr.ReadLine());
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
}
}
}
/*
run:
C#
Programming
Is Good For Business
*/