Languages
[Edit]
EN

C# / .NET - file copy

14 points
Created by:
Root-ssh
6417

In C# / .NET it is possible to copy file in following way.

1. File.Copy method example

using System;
using System.IO;
					
public class Program
{
	public static void Main()
	{
		string srcPath = @"C:\path\to\file.txt";
		string dstPath = @"C:\path\to\file_copy.txt";

		File.Copy(srcPath, dstPath);
	}
}

Result:

  1. File.Copy Method - Microsoft Docs
Hey 👋
Would you like to know what we do?
  • Dirask is a friendly IT community for learners, professionals and hobbyists to share their knowledge and help each other in extraordinary easy way.
  • We welcome everyone,
    no matter what the experience,
    no matter how basic the question is,
    this community will help you.