Search code examples
asp.netvb.netdts

How to copy txt/ doc File


I want to copy a txt file from one folder to another. While coping i need to check whether the file exists or not, if yess then replace the file.


Solution

  • You can use System.IO.File.Copy(source, destination, True) to copy a file. The third parameter says to overwrite any existing file).

    See this MSDN page for details.