HI All,
I am trying to make a small program that will copy the contents of one
folder into another folder automatically. This is for backup and i
want to just be able to run the program and have all the files be
copied. Didn't know if there was some API or some easy lines of code
that anyone knew of.
Thanks in advance
Reply Reply with quote
Herfried K. Wagner [MVP] - 21 Aug 2006 22:02 GMT
<andrew.varley@gmail.com> schrieb:
> I am trying to make a small program that will copy the contents of one
> folder into another folder automatically. This is for backup and i
> want to just be able to run the program and have all the files be
> copied. Didn't know if there was some API or some easy lines of code
> that anyone knew of.
Check out the classes in the 'System.IO' namespace, namely 'Directory' and
'File'. In addition you may want to take a look at
'My.Computer.FileSystem.CopyDirectory'.

Signature
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
adm - 21 Aug 2006 22:53 GMT
> HI All,
>
> I am trying to make a small program that will copy the contents of one
> folder into another folder automatically. This is for backup and i
> want to just be able to run the program and have all the files be
> copied.
since you mentioned "backup" and "automatically," i'm guessing you
might want this to backup a file whenever something is added to the
folder, or something like that. if that's the case, check out the stuff
mentioned by HW above, but more specifically, see FileSystemWatcher,
which is in System.IO.
Tutorial:
http://www.codeproject.com/dotnet/folderwatcher.asp
Steve Long - 22 Aug 2006 00:28 GMT
I wrote a program like this, except that it doesn't have the FileWatcher
stuff in it. You can have it if you want.
Steve
> HI All,
>
[quoted text clipped - 7 lines]
>
> Reply Reply with quote
busboy10 - 28 Aug 2006 18:22 GMT
Steve,
That would be great if you would send that to me. I just want to see
how you coded it.
Many thanks,
Andrew
> I wrote a program like this, except that it doesn't have the FileWatcher
> stuff in it. You can have it if you want.
[quoted text clipped - 12 lines]
> >
> > Reply Reply with quote
busboy10 - 28 Aug 2006 18:22 GMT
Steve,
That would be great if you would send that to me. I just want to see
how you coded it.
Many thanks,
Andrew
> I wrote a program like this, except that it doesn't have the FileWatcher
> stuff in it. You can have it if you want.
[quoted text clipped - 12 lines]
> >
> > Reply Reply with quote
busboy10 - 28 Aug 2006 18:22 GMT
Steve,
That would be great if you would send that to me. I just want to see
how you coded it.
Many thanks,
Andrew
> I wrote a program like this, except that it doesn't have the FileWatcher
> stuff in it. You can have it if you want.
[quoted text clipped - 12 lines]
> >
> > Reply Reply with quote