replace - visual basic copy file without asking -


in visual basic have program copies file , moves directory, if there no file name , extension, moves no problem. when same file in directory, asks if copy , replace or cancel, or copy , rename. how can have skip force replace file?

this using moving code:

dim directory = "c:\users\bryce\desktop\helloworld.txt"  my.computer.filesystem.copyfile("helloworld.txt", directory,     microsoft.visualbasic.fileio.uioption.alldialogs,     microsoft.visualbasic.fileio.uicanceloption.donothing) 

any way avoid notification? thanks. :d

the system.io namespace provides file.copy static method allows silent overwriting of destination file

  dim directory = "c:\users\bryce\desktop\helloworld.txt"   system.io.file.copy("helloworld.txt", directory, true) 

of course removes interface provided my.computer method , user has no way stop copying process. if file not big there no sense provide such interface. preferences , requirements.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -