streamwriter - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

streamwriter

kasirajankasirajan TamilNadu,indiaPosts: 6Member
edited April 2014 in C#
class Program
    {
        static void Main(string[] args)
        {``
            string[] names = new string[] { "kasi", "rajan" };
            using (StreamWriter sw = new StreamWriter(@"C:\Users\kasi\Desktop\jamica.txt")) 
            {
                foreach (string s in names)
                {
                    Console.WriteLine(s);
                }
            }
           string line = "";
            using (StreamReader sr = new StreamReader(@"C:\Users\kasi\Desktop\jamica.txt"))
            {
                while ((line = sr.ReadLine()) != null)
                {
                    Console.ReadLine();
                }
            }
            Console.ReadLine();
        }
    }
Tagged:

Comments

Sign In or Register to comment.