Skip to main content

Posts

Showing posts with the label FileStream in C#

FileStream in C#

  FileStream in C# Explained FileStream  in system.io namespace provides a  Stream  for a file, supporting both synchronous and asynchronous read and write operations. A stream is a flow of data from a source into a destination. The source or destination can be a disk, memory, socket, or other programs. When we use  FileStream , we work with bytes. For more convenient work with text data, we can use  StreamWriter  and  StreamReader . Writing text using   FileStream in C# In the following example, we write text data into a file with  FileStream . using System; using System.IO; using System.Text;   namespace WriteText {     class Program     {         static void Main( string [] args)         {             var fileName = @"C:\Users\Csharpnaija\Do...