0% found this document useful (0 votes)
23 views

Filehandling

File handling in .NET allows programs to store and manipulate data in files. It uses classes in the System.IO namespace to create, open, read, and write to files. The FileStream class provides access to files and supports data types like strings and numbers. Other classes like BinaryReader and StreamReader enable reading and writing different data types from files. Directories are collections of files that can be created and managed using the Directory class.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Filehandling

File handling in .NET allows programs to store and manipulate data in files. It uses classes in the System.IO namespace to create, open, read, and write to files. The FileStream class provides access to files and supports data types like strings and numbers. Other classes like BinaryReader and StreamReader enable reading and writing different data types from files. Directories are collections of files that can be created and managed using the Directory class.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

FILE HANDLING

FILE HANDLING
Peace of information stored on a permanent
storage device.
Implemented using namespace systems.io
Supports string, character and file manipulation.
Contain properties, methods and events for
creating, copying, moving, and deleting files.
Both strings and numeric data types are
supported, they also allow us to incorporate data
types in files
CLASS OF SYSTEM.IO
FileStream Class - Provides access to standard input
and output files.
Uses members of FileAccess, FileMode and
FileShare Enumerations with the constructors of
this class to create or open a file.
After a file is opened it's FileStream object can be
passed to the Binary Reader, BinaryWriter,
Streamreader and StreamWriter classes to work
with the data in the file.
FileStreamSeek method to move to various
locations in a file which allows to break a file into
records each of the same length.
CLASS OF SYSTEM.IO
StreamReader and StreamWriter Class - The
StreamReader and StreamWriter classes enables
us to read or write a sequential stream of
characters to or from a file.
BinaryReader and BinaryWriter Class - The
BinaryReader and BinaryWriter classes enable us
to read and write binary data, raw 0's and
1's, the form in which data is stored on the
computer.


DIRECTORIES
Collection of files and subfolders.
The Directory class allows us to create and work
with Folders/Directories.
We can create, rename folders and also maintain
drives on the machine.
To create a new directory we should use the
Directory class's CreateDirectory method.

You might also like