C# / .NET Program Tutorial

Copying file from one destination to another destination in C# using System.IO.File Class

Step 1: Import System.IO class
Step 2: Create a test file in your local system.
Step 3: Give Source and Destination Path, which should be available on your system.
Step 4: Combine Path with File name using System.IO.Path class. You can also using basic string concordinate.
Step 5: Check if Direct is exist before moving the file.
Step 6: Use File.Copy static method to move the file.

Note: If you have any queries, please write in below comment box.

Leave a Reply

Your email address will not be published. Required fields are marked *