Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 16th, 2006, 9:44 PM   #1
NightShade01
Programmer
 
Join Date: Oct 2005
Posts: 52
Rep Power: 3 NightShade01 is on a distinguished road
Copying files

Ok Suppose i have two directories
dim source as string = "C:\MyFiles"
dim dest as string = "C:\Mybackup"

now if the MyFiles folder contains 5 documents:
file1.doc
file2.doc
file3.doc
file4.doc
file5.doc

I want to click a button, have it check to see if the dest exsists, if it does and there are files in it, get those files and copy them to the backup folder.
So far i have:

dim source as string = "C:\MyFiles"
dim dest as string = "C:\Mybackup"

if directory.exsists(source) then
      dim sFiles() as string
      sFiles = Directory.GetFiles(source, "*.doc", SearchOption.TopDirectoryOnly)

'Stuck here after getting the files
'array copy method of some sort?
NightShade01 is offline   Reply With Quote
Old Aug 16th, 2006, 10:14 PM   #2
AntiNinja
Hobbyist Programmer
 
AntiNinja's Avatar
 
Join Date: Jun 2006
Location: The States
Posts: 101
Rep Power: 3 AntiNinja is on a distinguished road
Send a message via AIM to AntiNinja Send a message via Yahoo to AntiNinja
xcopy C:\MyFiles C:\MyBackup /E
..I dont know VB sorry, just thought I'd show you a quick and easy way.
__________________
Pain is just weakness leaving the body.
AntiNinja is offline   Reply With Quote
Old Aug 17th, 2006, 11:49 AM   #3
bigguy
Professional Programmer
 
bigguy's Avatar
 
Join Date: Sep 2005
Location: Arkansas
Posts: 298
Rep Power: 0 bigguy is an unknown quantity at this point
Send a message via AIM to bigguy Send a message via MSN to bigguy Send a message via Yahoo to bigguy
MSDN has a example look under CopyFile method
__________________
Forgiveness is the fragrance that the violet sheds on the heal that has crushed it. - Mark Twain

Destruction leads to a very rough road, but it also breeds creation.
bigguy is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unix commands compatible with Windows? titaniumdecoy Bash / Shell Scripting 7 Oct 5th, 2006 7:25 AM
Command Prompt SkyPioneer Coder's Corner Lounge 5 May 3rd, 2006 10:07 PM
copying files first before deleting them harjit Visual Basic 1 May 15th, 2005 7:05 AM
Checking source codes of image, audio and video files on_auc C++ 3 Feb 21st, 2005 8:36 PM
shutil.copy corrupting files? TimL Python 0 Feb 20th, 2005 3:32 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:48 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC