In Focus
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

  • How To Read A Text File In C#

    This code sample shows how to read a text file in C# using the File class and its methods.
  • Working With The FileInfo Class In C#

    This article will explain the FileInfo class and its use.
  • 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.
  • How to Get a File Extension in C#

    How to get a file extension using C# and .NET. The Extension property of the FileInfo class returns the extension of a file.
  • 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.
  • Accessing and Maintaining Log Files

    This article defines how to retrieve values from Log files and Event Log View.
  • Copy files from one directory to another

    How to get all file names from a directory/Folder and copy it to another location
  • Remove ReadOnly file attribute

    See this blog code to remove ReadOnly file attribute.
  • File Manager in C#

    File manager is an application that sorts the users file from the system into the proper directory.
  • File Encoding And Decoding In .Net Using Simple IO Operations

    In this blog we will discuss how to encode and decode the files using simple IO operations in .Net.
  • View More