Tuesday, July 28, 2009

How to copy a file to a directory in Visual Basic?

I need a way that if the user click ok it copies say test.exe to a directory on there computer such as C:/Programs and Settings/Test/


Can anyone tell me the code or have a link?


Im using Visual Basic(.Net) for this project

How to copy a file to a directory in Visual Basic?
Not sure if VB.NET has it, but in VB-6 there was an object called the File System Object, available from the reference of Microsoft Scripting Runtime (available in the References window in the IDE). Check if VB.NET has it.
Reply:imports System.IO





' to copy a file:


File.Copy(src, dest)
Reply:system.IO.File.Copy





There's loads of useful functions there, like move, create, exists, Append text, etc...





Cheers


No comments:

Post a Comment