Files, Directory, IO
Welcome to Files and IO section of C# Corner. In this section, you will find resources related to System.IO namespace and related classes including File, Directory, System.IO, BinaryReader, BinaryWriter, DriveInfo, FileStream, Stream,StreamReader, StreamWriter, TextReader, TextWriter, StringReader, and StringWriter.

RECENT POSTS

  • Working With DirectoryInfo In C#

    This article will explain the DirectoryInfo class and its uses and how to work with folders in C#.
  • Working With FileInfo In C#

    C# FileInfo class provides functionality to work with files. This article will explain how to use a FileInfo class in C# to work with files and folders.
  • Working With File Class In C#

    C# File Class. In this article, I'll explain how to use File class in C# to create, move, and work with files in .NET.
  • A Complete C# Directory Tutorial

    The C# Directory class provides static methods for working with a directories and folders in C# such as get current working directory. The code examples in this tutorial show - How to create a folder
  • How to get a file size in C#

    C# Get File Size. Learn how to get a file size in bytes using C# using the FileInfo.Length property.
  • How to Get a File Extension in C#

    C# get file extension. FileInfo.Extension property returns the file extension in C#.
  • Create a Directory in C#

    How to create a directory or folder using C# and .NET.
  • How To Read A Text File In C#

    Learn how to read a text file in C# using the File class and its methods.
  • Create a file using FileInfo in C#

    Code sample to show how to create a file in C# and get a file attributes such as file creation time, file size, file last updated, file last accessed, and file last write time.
  • Create a Text File in C#

    There are multiple ways you can create files in C# and .NET. This article provides code samples to create files in C# using File.Create() method, File.CreateText(), FileInfo.Create, and FileInfo.Creat
  • Read a binary file in C#

    How to read a binary file in C# and .NET. The Read overloaded method is used to write primitive data types to a stream. The Write method can write a Boolean, Byte, Char, Decimal, Double, and Integer d
  • Move a directory in C#

    How to move a directory using C# and .NET. The Directory.Move method moves an existing directory to a new specified directory with full path.
  • How to write a binary file in C#

    How to write a binary file using C# and .NET. The Write overloaded method is used to write primitive data types to a stream. The Write method can write a Boolean, Byte, Char, Decimal, Double, and Inte
  • How to create a Binary File using C#

    How to create and write to a binary fine using C# and .NET. The System.IO.BinaryWriter class is used to write binary data to a stream. This class also provides an option to specify the character encod
  • How to get full path of a file in C#

    How to get full path of a file using C# and .NET. The FullName property returns just the full path of a file including the file name.
  • File creation time in C#

    How to check when a file was created in C#. The CreationTime property returns the DateTime when a file was created.
  • How to check if a file is read only in C#

    How to check if a file is read only in C#. The IsReadOnly property of the FileInfo class returns if a file is read only.
  • How to check if a file exists in C#

    How to check if a file exists in C# and .NET. The Exists property of the FileInfo class returns true if a file exists.
  • How To Get File Name In C#

    How to get a file name in C#. The FileInfo.FileName property returns just the file name part of the full path of a file.
  • Delete A directory In C#

    How to delete a directory in C# and .NET. The System.IO.Directory class in the .NET Framework class library provides static methods for creating, copying, moving, and deleting directories and subdirec
  • Processing Folders Iteratively

    This article provides a sample of retrieving file system directories iteratively.
  • How to Manage Files which have no Checked in Version

    In this blog we are going to see how to manage files which are not checked in.
  • Password Discovery and Patching by Disassembling

    This article shows how to subvert some of authentication mechanisms, such as extracting vital information imposed in the binary file while source coding, by analyzing the generated hex code itself of the target executable.
  • There is not Enough Memory to Complete this Operation when Trying to Close the Project Professional

    There is not enough memory to complete this operation when trying to close the Project Professional.
  • File I/O Using C#

    In this article, you will learn how to work with classes in the System.IO namespace for reading data from and writing data to files.
  • View More