auxcom Posted May 6, 2004 Posted May 6, 2004 In VB6 I use FileSystemObject to copy a file to another folder or location. How to do this in the .NET way? Thanks! Quote
Administrators PlausiblyDamp Posted May 6, 2004 Administrators Posted May 6, 2004 IIRC System.IO.File.Copy should do the trick Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Arch4ngel Posted May 6, 2004 Posted May 6, 2004 If you want to move... delete the source file after a successful copy with System.IO.File.Delete Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
Administrators PlausiblyDamp Posted May 6, 2004 Administrators Posted May 6, 2004 If he want's to move then I would have though System.IO.File.Move would have been a better choice than your suggestion of copy and delete.... Just a thought..... Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Arch4ngel Posted May 6, 2004 Posted May 6, 2004 Ya... LOL Didn't even take the time to look. Should lead to the same result in efficiency or maybe a LITTLE difference. But .Move is sure more simple and require less line of code. Should have watch my back when I threw than post... got another one in my back LOL :p Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.