How to copy a file in C#

前端 未结 5 1308
闹比i
闹比i 2020-12-17 21:26

I want to copy a file from A to B in C#. How do I do that?

5条回答
  •  死守一世寂寞
    2020-12-17 21:42

    This should work!

    using System.IO;
    
    ...
    
    var path = //your current filePath
    var outputPath = //the directory where you want your (.txt) file
    
    
    File.Copy(path,outputPath);
    

提交回复
热议问题