Below is the code which will demonstrate how to append the contents to the file.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace File_directory_demo
{
class Program
{
static void Main(string[] args)
{
System.IO.File.Create("e:\\abc.txt");
System.IO.File.AppendAllText("e:\\abc.txt", "\n I am living in ahmednagar");
byte[] b=System.IO.File.ReadAllBytes("e:\\abc.txt");
for(int i=0;i {
Console.Write((char)b[i]);
}
Console.ReadKey();
}
}
}
Comments
Post a Comment