Skip to content

Tag Archives: CSharp-File-Handling

C# is a general-purpose, modern and object-oriented programming language pronounced as “C Sharp”, in which we can create files. Sometimes we need to do perform… Read More
C# is a general-purpose,  object-oriented programming language pronounced as “C Sharp”. It is a lot syntactically similar to Java and is easy for users who… Read More
The size of the folder is a sum of the size of files and subfolders included in the folder. Here, we will learn to calculate… Read More
Given a file, now our task is to copy data from one file to another file by overwriting the same file name using C#. So… Read More
A directory is a file system that stores file. Now our task is to create a directory in C#. We can create a directory by… Read More
Given a directory, now our task is to check given directory exists or not. So to this task, we use the Exists() method of the… Read More
Given a directory(empty or non-empty), now we have to delete the given directory. Here, an empty directory means the directory is present without any files… Read More
Given a file, now our task is to read lines from the file until the end of the file using C#. Before reading the lines… Read More
Given a file, now our task is to get the file time using the File class. So we use the GetCreationTime() method of the File… Read More
Given a file, our task is to view the date and time of access to a file. So to do this we use the following… Read More
The FileStream is a class used for reading and writing files in C#. It is part of the System.IO namespace. To manipulate files using FileStream,… Read More
File.Replace(String, String, String) is an inbuilt File class method that is used to replace the contents of a specified destination file with the contents of… Read More
File.WriteAllText(String, String, Encoding) is an inbuilt File class method that is used to create a new file, writes the specified string to the file using… Read More
File.WriteAllText(String, String) is an inbuilt File class method that is used to create a new file, writes the specified string to the file, and then… Read More
File.ReadAllText(String, Encoding) is an inbuilt File class method that is used to open a text file then reads all the text in the file with… Read More

Start Your Coding Journey Now!