Copy a text file to another physical location using System.IO.File

Category VB.Net Sub Category File I/O
Bookmark and Share
As long as you have the permissions to write to the folder, use the System.IO.File.Copy method to do this.
A simple example of how to make a copy of a file and change the postfix to include -Enc (in this example to define an encrypted file)

Copy Code
System.IO.File.Copy(LocationFileName, LocationFileName.Replace(".txt", "-Enc.txt"), True)
Share the love
Bookmark and Share