This code is working frin for me but the issue is that instead of destication folder on local or inside my app_data folder i want to be on server like here
http://ABC.com/test2/
public static void CopyAll(DirectoryInfo source, DirectoryInfo target)
{
// Check if the target directory exists, if not, create it.
if (Directory.Exists(target.FullName) == false)
{
Directory.CreateDirectory(target.FullName);
}
// Copy each file into it's new directory.
foreach (FileInfo fi in source.GetFiles())
{
Console.WriteLine(@"Copying {0}\{1}", target.FullName, fi.Name);
fi.CopyTo(Path.Combine(target.ToString(), fi.Name), true);
}
// Copy each subdirectory using recursion.
foreach (DirectoryInfo diSourceSubDir in source.GetDirectories())
{
DirectoryInfo nextTargetSubDir =
target.CreateSubdirectory(diSourceSubDir.Name);
CopyAll(diSourceSubDir, nextTargetSubDir);
}
}
shafiqkr
Member
454 Points
372 Posts
Copy Files Issue
Mar 01, 2012 06:23 AM|LINK
Hi,
i have an asp.net template web site in zip file in my App_Data Folder.my application path is like this
http://ABC.com/test/
and source folder is like this
Server.MapPath("App_Data/Template");
i want to copy this template to another folder on server like i want to copy to this folder
http://ABC.com/test2/
i am using dll DOTNETZIP
using Ionic.Zip;
help me out how to do it.
Note:if we keep our template in folder/directory instead of zip and copy it to test2.i think this will be better.
What and how to do as i have tried alot but give me alot of issues
shafiqkr
Member
454 Points
372 Posts
Re: Copy Files Issue
Mar 01, 2012 06:39 AM|LINK
This code is working frin for me but the issue is that instead of destication folder on local or inside my app_data folder i want to be on server like here
http://ABC.com/test2/
Dino He - MS...
Star
8068 Points
1023 Posts
Microsoft
Re: Copy Files Issue
Mar 05, 2012 06:12 AM|LINK
Hi
You can refer to this link:
How to: Copy, Delete, and Move Files and Folders (C# Programming Guide)
Hope it helpful.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework