c#,text,operations,file

Kerim 8/12/2016 0

This Code Performs Text Operations in a File

C#
 using System;
using System.IO;
class Program
{
    static void Main()
    {
        FileInfo finfo = new FileInfo("C:\\sri\\srip.txt");
        using (StreamWriter writer = finfo.AppendText())
        {
            writer.WriteLine("New File with various Text operations");
        }
        finfo = new FileInfo("C:\\sri\\srip.txt");
        using (StreamWriter writer = finfo.CreateText())
        {
            writer.WriteLine("New File with various Text operations");
        }
        using (StreamReader reader = finfo.OpenText())
        {
            Console.WriteLine(reader.ReadToEnd());
        }
        Console.Read();
    }
} 

/*
Here is the output of the C# Program: New File with various Text operations

*/

Report Bug

Please Login to Report Bug

Reported Bugs

Comments

Please Login to Comment

Comments