You need to import the System.IO namespace :
<%@ Import Namespace="System.IO" %>
Then, for your code :
File.Copy("C:\\Dir1\\file.ext", @"C:\AnotherDir\file.ext");
Feel free to substitute variables for the actual paths.
You can also use different drives.
Make sure your ASP.NET account has write permissions
to the directory where the file is being copied to.
Juan T. Llibre, asp.net MVP
asp.net faq :
http://asp.net.do/faq/
foros de asp.net, en español :
http://asp.net.do/foros/
======================================
"Paul" <> wrote in message news:53B6D6F5-278C-4525-AF5A-...
> Hi just wondering if there is any sample code to copy files from one
> directory into another with the code behind a button click event? Using c#
> vs2005.
> Thanks.
> --
> Paul G
> Software engineer.