c# - how to copy all *.bak files from Directory A to Directory B? -


how copy *.bak files directory a directory b?

this should need:

string dira = @"c:\"; string dirb = @"d:\";  string[] files = system.io.directory.getfiles(dira);  foreach (string s in files) {     if (system.io.path.getextension(s).equals("bak")) {         system.io.file.copy(s, system.io.path.combine(targetpath, filename), true);     } } 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -