|
-
May 7th, 2011, 01:26 PM
#3
Re: permission denied execption
Look at this code:
using System;
using System.IO;
Code:
class Program
{
static void Main()
{
// Write initial contents of File B.
Console.WriteLine(File.ReadAllText("file-b.txt"));
// "File B contents."
// COPY:
// Copy one file to a location where there is a file.
File.Copy("file-a.txt", "file-b.txt", true); // overwrite = true
// Display the contents of both files
Console.WriteLine(File.ReadAllText("file-a.txt"));
Console.WriteLine(File.ReadAllText("file-b.txt"));
}
}
http://www.dotnetperls.com/file-copy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|