p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Visual Basic 2005 Basics (http://p2p.wrox.com/forumdisplay.php?f=137)
-   -   Need help with a copy code (http://p2p.wrox.com/showthread.php?t=62253)

JimmieC123 September 22nd, 2007 11:54 PM

Need help with a copy code
 
Hello,
I am writing a code to copy files to a new location and the way I have it set up is to browse t the source location and have that pasted into textbox1. Then use the folder browser to specify a new location and have that pasted into textbox2.
I would like to have a button that will then copy that the file specified to the location specified.

My issue is that I am not sure how to do this using the FileSystemObject. So far I have:

        Dim fso

        fso = CreateObject("File.Copy")

but I am not sure if i am going the right direction or not.
I'm not sure how to make the copy command read the file that is shown in textbox1 and copy it into the location in textbox2.

Any help would be greatly appreciated as I have a dead line for this that is coming up very quickly.

Thank you again,

Jimmie

Imar September 23rd, 2007 03:04 AM

Hi Jimmie,

If you're using Visual Basic 2005, you shouldn't use the FileSystemObject. Instead, look at classes like System.IO.File, System.IO.Directory etc.

http://msdn2.microsoft.com/en-us/lib...m.io.file.aspx
http://msdn2.microsoft.com/en-us/lib...directory.aspx

You'll find convenient methods like CreateDirectory, Move, Delete and so on that allow you to work with files and folders.

Hope this helps,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004


All times are GMT -4. The time now is 05:43 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.