Programming Forums
User Name Password Register
 

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

Reply
 
Thread Tools Display Modes
Old Apr 24th, 2005, 3:17 PM   #1
TCStyle
Programmer
 
Join Date: Jan 2005
Location: Albany, NY
Posts: 43
Rep Power: 0 TCStyle is on a distinguished road
Moving files....

Okay, so I'm using VB.net 2005 (just to let all of you know). What I want to do, is have it so that when a button is clicked, it moves a certain folder from one location, to another, and over writes the folder if necessary. Can someone hook me up with a tutorial or script? Thanks in advance!
TCStyle is offline   Reply With Quote
Old Apr 24th, 2005, 4:25 PM   #2
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
This is where IO.Directory comes in. It has functions to tell if a directory exists and to move them. So it comes down to some simple pseudocode:

if the target directory exists
   tell the user
   stop
otherwise
    move the source to target
Dameon is offline   Reply With Quote
Old Apr 25th, 2005, 12:14 AM   #3
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,473
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
welcome to .NET this will work in VB.Net AND C# .Net

Environment.Directory.Exists(DIRVAR)

Environment.File.Exists(FILEVAR)
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Apr 25th, 2005, 7:06 AM   #4
TCStyle
Programmer
 
Join Date: Jan 2005
Location: Albany, NY
Posts: 43
Rep Power: 0 TCStyle is on a distinguished road
Thanks

Quote:
Originally Posted by Infinite Recursion
Environment.Directory.Exists(DIRVAR)
Environment.File.Exists(FILEVAR)
Very nice, thanks!
TCStyle 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




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

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