Hi,
You do not need to create a FileInfo, Even so you do not have to check the
existence of the directory.
Directory.CreateDirectory( ) will create the directory path if needed
then use File.Copy( source, target );
Cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
<ka************@singularity.co.uk> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I am trying to copy a file with a css extension using the following
code
if (!DoesDirectoryExists(sLocation))
{
//Create the directory
Directory.CreateDirectory(sLocation);
}
FileInfo test = new FileInfo(sFile);
test.CopyTo(sLocation, true);
The location is c:\test.css and the location is c:\test2\test.css
After running this code a directory called test.css is created and no
file is copied.
Any help on this would be greatly appreciated
Thanks
Karen