Click here to Skip to main content
15,892,643 members
Home / Discussions / C#
   

C#

 
GeneralRe: return value Pin
DaveyM696-May-09 9:36
professionalDaveyM696-May-09 9:36 
AnswerRe: return value Pin
OriginalGriff6-May-09 6:14
mveOriginalGriff6-May-09 6:14 
GeneralRe: return value Pin
musefan6-May-09 6:21
musefan6-May-09 6:21 
GeneralRe: return value Pin
Henry Minute6-May-09 7:14
Henry Minute6-May-09 7:14 
Questiondefinivelty confused about sqlite as embedded database Pin
highjo6-May-09 5:18
highjo6-May-09 5:18 
GeneralRe: definivelty confused about sqlite as embedded database Pin
highjo6-May-09 6:33
highjo6-May-09 6:33 
QuestionNeed to copy folder from one path to other Pin
honeyashu6-May-09 4:55
honeyashu6-May-09 4:55 
AnswerRe: Need to copy folder from one path to other Pin
musefan6-May-09 6:11
musefan6-May-09 6:11 
OK, this one is not as easy as you would like to think. As far as I know you need to do all the work here.

Basically, you should first obtain you two folder paths. Application path can be obtained using...

string sourceDir = Application.StartupPath + "\\FolderToCopy";


Then you destination path should be available in the System.Environment.SpecialFolder enum, im not sure which one you will want to use thou so either test a few or google for answers...

string destDir = System.Environment.SpecialFolder.ApplicationData;//I guess this one is right


Now you need to create a recursive function that will copy a folder and all sub-folders and files. Keep in mind this is off top of my head so sorry if it does not work as it should...

void CopyFolder(string source, string destination)
{
   System.IO.DirectoryInfo info = new System.IO.DirectoryInfo(source);//get info for the folder
   System.IO.Directory.CreateDirectory(destination);//create the folder
   
  foreach(System.IO.FileInfo file in info.GetFiles())
  {
     file.CopyTo(destination + "\\" + file.Name);
  }

  foreach(System.IO.DirectoryInfo dir in info.GetDirectories())
  {
    CopyFolder(dir.FullName, destination + "\\" + dir.Name);
  }

}


..sorry if it does'nt work properly, but im sure you can google for 'C# Copy Directory' and get the code you need

Life goes very fast. Tomorrow, today is already yesterday.

GeneralRe: Need to copy folder from one path to other Pin
Member 10339076-May-09 10:23
Member 10339076-May-09 10:23 
Questionmake a new object in an event! Pin
pcsience6-May-09 4:44
pcsience6-May-09 4:44 
QuestionRe: make a new object in an event! Pin
OriginalGriff6-May-09 4:53
mveOriginalGriff6-May-09 4:53 
QuestionRe: make a new object in an event! Pin
pcsience6-May-09 5:37
pcsience6-May-09 5:37 
AnswerRe: make a new object in an event! Pin
musefan6-May-09 5:49
musefan6-May-09 5:49 
QuestionRe: make a new object in an event! Pin
pcsience6-May-09 7:55
pcsience6-May-09 7:55 
AnswerRe: make a new object in an event! Pin
Henry Minute6-May-09 9:06
Henry Minute6-May-09 9:06 
QuestionRe: make a new object in an event! Pin
pcsience6-May-09 11:38
pcsience6-May-09 11:38 
AnswerRe: make a new object in an event! Pin
Henry Minute6-May-09 12:01
Henry Minute6-May-09 12:01 
GeneralRe: make a new object in an event! Pin
pcsience9-May-09 2:29
pcsience9-May-09 2:29 
QuestionCompositeDataBoundControl designer crashes VS2008 Pin
Andre Vianna6-May-09 4:40
Andre Vianna6-May-09 4:40 
Questionproblem in C# Pin
kakarman6-May-09 4:26
kakarman6-May-09 4:26 
AnswerRe: problem in C# Pin
musefan6-May-09 4:29
musefan6-May-09 4:29 
AnswerRe: problem in C# Pin
led mike6-May-09 4:37
led mike6-May-09 4:37 
AnswerRe: problem in C# Pin
Luc Pattyn6-May-09 4:38
sitebuilderLuc Pattyn6-May-09 4:38 
QuestionCrystal report binding Pin
KIDYA6-May-09 3:31
KIDYA6-May-09 3:31 
QuestionHTK Pin
dileeparuwan6-May-09 3:25
dileeparuwan6-May-09 3:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.