Skip to content
Courses
DSA to Development
Get IBM Certification
Newly Launched!
Master Django Framework
Become AWS Certified
For Working Professionals
Interview 101: DSA & System Design
Data Science Training Program
JAVA Backend Development (Live)
DevOps Engineering (LIVE)
Data Structures & Algorithms in Python
For Students
Placement Preparation Course
Data Science (Live)
Data Structure & Algorithm-Self Paced (C++/JAVA)
Master Competitive Programming (Live)
Full Stack Development with React & Node JS (Live)
Full Stack Development
Data Science Program
All Courses
Tutorials
Data Structures & Algorithms
ML & Data Science
Interview Corner
Programming Languages
Web Development
CS Subjects
DevOps And Linux
School Learning
Practice
Build your AI Agent
GfG 160
Problem of the Day
Practice Coding Problems
GfG SDE Sheet
Contests
Accenture Hackathon (Ending Soon!)
GfG Weekly [Rated Contest]
Job-A-Thon Hiring Challenge
All Contests and Events
DSA
Practice Problems
Python
C
C++
Java
Courses
Machine Learning
DevOps
Web Development
System Design
Aptitude
Projects
Sign In
▲
Similar Topics
Web Technologies
40.3k+ articles
DSA
22.3k+ articles
Python
20.1k+ articles
Experiences
17k+ articles
Interview Experiences
13.6k+ articles
School Learning
11.7k+ articles
JavaScript
11.5k+ articles
C#
1.8k+ articles
C# Programs
140+ articles
CSharp-programs
80 articles
CSharp-File-Handling
63 posts
Popular Articles
Recent Articles
C# Program to Create a Directory
Last Updated: 30 November 2021
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 using the CreateDir
...read more
C#
Picked
C# Programs
CSharp-File-Handling
C# Program to Delete an Empty and a Non-Empty Directory
Last Updated: 30 November 2021
Given a directory(empty or non-empty), now we have to delete the given directory. Here, an empty directory means the directory is present wi
...read more
C#
Picked
C# Programs
CSharp-File-Handling
Basics of FileStream in C#
Last Updated: 25 April 2025
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 FileStr
...read more
C#
CSharp-File-Handling
Similar Topics
Web Technologies
40.3k+ articles
DSA
22.3k+ articles
Python
20.1k+ articles
Experiences
17k+ articles
Interview Experiences
13.6k+ articles
School Learning
11.7k+ articles
JavaScript
11.5k+ articles
C#
1.8k+ articles
C# Programs
140+ articles
CSharp-programs
80+ articles
File.Replace(String, String, String) Method in C# with Examples
Last Updated: 25 April 2025
File.Replace(String, String, String) is an inbuilt File class method that is used to replace the contents of a specified destination file wi
...read more
C#
CSharp-File-Handling
File.WriteAllText(String, String) Method in C# with Examples
Last Updated: 01 June 2020
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
...read more
C#
CSharp-File-Handling
File.ReadAllText(String, Encoding) Method in C# with Examples
Last Updated: 25 April 2025
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
C#
CSharp-File-Handling
File.ReadAllLines(String) Method in C# with Examples
Last Updated: 25 April 2025
File.ReadAllLines(String) is an inbuilt File class method that is used to open a text file then reads all lines of the file into a string ar
...read more
C#
CSharp-File-Handling
File.Open(String, FileMode) Method in C# with Examples
Last Updated: 25 April 2025
File.Open(String, FileMode) is an inbuilt File class method which is used to open a FileStream on the specified path with read/write access
...read more
C#
CSharp-File-Handling
File.WriteAllBytes() Method in C# with Examples
Last Updated: 25 April 2025
File.WriteAllBytes(String) is an inbuilt File class method that is used to create a new file then writes the specified byte array to the fil
...read more
C#
CSharp-File-Handling
File.OpenRead() Method in C# with Examples
Last Updated: 25 April 2025
File.OpenRead(String) is an inbuilt File class method which is used to open an existing file for reading.Syntax: public static System.IO.
...read more
C#
CSharp-File-Handling
File.Delete() Method in C# with Examples
Last Updated: 25 April 2025
File.Delete(String) is an inbuilt File class method which is used to delete the specified file.Syntax: public static void Delete (string
...read more
C#
CSharp-File-Handling
File.AppendText() Method in C# with Examples
Last Updated: 25 April 2025
File.AppendText() is an inbuilt File class method which is used to create a StreamWriter that appends UTF-8 encoded text to an existing file
...read more
C#
CSharp-File-Handling
File.ReadAllBytes() Method in C# with Examples
Last Updated: 25 April 2025
File.ReadAllBytes(String) is an inbuilt File class method that is used to open a specified or created binary file and then reads the content
...read more
C#
CSharp-File-Handling
File.Exists() Method in C# with Examples
Last Updated: 25 April 2025
File.Exists(String) is an inbuilt File class method that is used to determine whether the specified file exists or not. This method returns
...read more
C#
CSharp-File-Handling
How to Read and Write a Text File in C#?
Last Updated: 01 April 2020
Termination of a program leads to the deletion of all data related to it. Therefore, we need to store the data somewhere. Files are used for
...read more
C#
CSharp-File-Handling
1
2
3
4
5
>>
Last
1
2
3
4
5
>>
Last
1
2
3
4
>>
Last
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !