asp.net c# vb.net asp.net web design resources articles and tutorials
All Categories
VB.Net
ASP.Net
Javascript
HTML
CSS
SQL
Graphics
Web Design
Business
VBScript
AJAX
JQuery
Home
VB.Net
VBScript
ASP.Net
AJAX
JavaScript
JQuery
HTML
CSS
SQL
Graphics
Web Design
Business
Copy a text file to another physical location using System.IO.File
Category
VB.Net
Sub Category
File I/O
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
Choose a SubCategory
Blogs
C# - VB.Net Comparison
Class
Declarations
Encryption
File I/O
General
Lead Generation
Links
Manipulating Types
Regular Expressions
Standards
Statements
Transactions
Usability
Utilities Bespoke