Home All Groups Group Topic Archive Search About

Automated File Copying

Author
21 Aug 2006 8:56 PM
andrew.varley
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

Author
21 Aug 2006 9:02 PM
Herfried K. Wagner [MVP]
<andrew.var***@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'.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>
Author
21 Aug 2006 9:53 PM
adm
andrew.var***@gmail.com wrote:
> 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
Author
21 Aug 2006 11:28 PM
Steve Long
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

<andrew.var***@gmail.com> wrote in message
Show quoteHide quote
news:1156193769.659770.91240@i42g2000cwa.googlegroups.com...
> 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
>
Author
28 Aug 2006 5:22 PM
busboy10
Steve,

That would be great if you would send that to me.  I just want to see
how you coded it.

Many thanks,
Andrew


Steve Long wrote:
Show quoteHide quote
> 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
>
> <andrew.var***@gmail.com> wrote in message
> news:1156193769.659770.91240@i42g2000cwa.googlegroups.com...
> > 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
> >
Author
28 Aug 2006 5:22 PM
busboy10
Steve,

That would be great if you would send that to me.  I just want to see
how you coded it.

Many thanks,
Andrew


Steve Long wrote:
Show quoteHide quote
> 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
>
> <andrew.var***@gmail.com> wrote in message
> news:1156193769.659770.91240@i42g2000cwa.googlegroups.com...
> > 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
> >
Author
28 Aug 2006 5:22 PM
busboy10
Steve,

That would be great if you would send that to me.  I just want to see
how you coded it.

Many thanks,
Andrew


Steve Long wrote:
Show quoteHide quote
> 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
>
> <andrew.var***@gmail.com> wrote in message
> news:1156193769.659770.91240@i42g2000cwa.googlegroups.com...
> > 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
> >