Given a file, and we have to move it from one location to another location using C# program.
File.Move()
This is a method of "File class, which is used to move a file from one location (source) to another location (destination).
Syntax:
File.Move(source_file, dest_file);
Parameter(s):
- source_file - Location of source file.
- dest_file - Location of destination file, and here we can change filename.
We can set following detail of last write time:
- Date
- Month
- Year
- Hour
- Minute
- Second
- AM/PM
-
Program
Output
Note: In above program, we need to remember, when we use "File" class, System.IO namespace must be included in the program.