File related operation of opening the existing file for reading and writing.

Amatya
Posted by Amatya under C# category on | Points: 40 | Views : 1417
File related operation of opening the existing file for reading and writing.
We will have to add namespace 'using System.IO ;'


using (var fileStream = new FileStream(@"c:\dnf.txt", FileMode.Open))
{
// To read from dnf text file or write to dnf text file
}


Here dnf.txt file should be in C drive of the system.

Thanks

Comments or Responses

Login to post response