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
Post a Comment