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

  • Dinesh Beniwal

    How To Set File Last Write Time in C#

    In this article we will discuss about how to Set File Last Write Time in C#.
    Dinesh Beniwal Dec 01, 2019
  • Micalgray

    Working With DirectoryInfo In C#

    This article will explain the DirectoryInfo class and its uses and how to work with folders in C#.
    Micalgray Sep 02, 2019
  • Rohatash Kumar

    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.
    Rohatash Kumar Aug 25, 2019
  • Rohatash Kumar

    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.
    Rohatash Kumar Aug 25, 2019
  • Mahesh Chand

    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 fold...
    Mahesh Chand Aug 25, 2019
  • Mahesh Chand

    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.
    Mahesh Chand Jun 16, 2019
  • Mahesh Chand

    How to Get a File Extension in C#

    C# get file extension. FileInfo.Extension property returns the file extension in C#.
    Mahesh Chand Jun 11, 2019
  • Mahesh Chand

    Create a Directory in C#

    How to create a directory or folder using C# and .NET.
    Mahesh Chand Jun 11, 2019
  • Mahesh Chand

    How To Read A Text File In C#

    Learn how to read a text file in C# using the File class and its methods.
    Mahesh Chand May 03, 2019
  • Mahesh Chand

    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.
    Mahesh Chand Jan 16, 2019
  • Mahesh Chand

    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.Cr...
    Mahesh Chand Jan 16, 2019
  • Mahesh Chand

    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 Intege...
    Mahesh Chand Dec 20, 2018
  • Mahesh Chand

    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.
    Mahesh Chand Dec 20, 2018
  • Mahesh Chand

    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 I...
    Mahesh Chand Dec 20, 2018
  • Mahesh Chand

    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 en...
    Mahesh Chand Dec 20, 2018
  • Mahesh Chand

    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.
    Mahesh Chand Dec 20, 2018
  • Mahesh Chand

    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.
    Mahesh Chand Dec 20, 2018
  • Mahesh Chand

    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.
    Mahesh Chand Dec 20, 2018
  • Mahesh Chand

    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.
    Mahesh Chand Dec 20, 2018
  • Mahesh Chand

    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.
    Mahesh Chand Aug 30, 2018
  • Mahesh Chand

    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 subdi...
    Mahesh Chand Aug 30, 2018
  • Sam Hobbs

    Processing Folders Iteratively

    This article provides a sample of retrieving file system directories iteratively.
    Sam Hobbs Dec 23, 2015
  • Manpreet Singh

    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.
    Manpreet Singh Mar 14, 2015
  • Ajay Yadav

    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 ...
    Ajay Yadav Feb 25, 2015
  • Shweta Lodha

    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.
    Shweta Lodha Apr 23, 2014
  • View More