c# - How do i copy files from one directory to another directory? -


string[] s = directory.getfiles(t, "*.txt",searchoption.alldirectories); (int = 0; < s.length; i++) {     file.copy(s[i], } 

file.copy copy files file name. want keep same files names copy them 1 directory directory.

use this:

 file.copy(s[i], "c:\\anotherfolder\\" + path.getfilename(s[i])); 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -