How to Copy , Delete File in C#
The File class we can use to get and set file attributes or DateTime information related to the creation, access, and writing of a file. Also we can use File class for copying, moving, delete , renaming etc. to file.
FileNotFoundException Class is throw the exception when an attempt to access a file that does not exist on disk fails. IOException is the base class for exceptions thrown while accessing information using streams, files and directories.
The following C# program shows how to use File Class for copying and deleting a text file and also its shows how to handle System.IO.FileNotFoundException Class.