Require references the namespace: use system.io;
///
Public Static Void CopyFolder (String strfromath) {// If the source folder does not exist, create if (! Directory.exists (strFromPath)) {Directory.createdIRectory (StrFromPath);
// Name String strfoldername = strFromPath.LastIndexof ("//") 1, strfromPath.length - strfromPath.LastInDexof ("/////////////////////////////////") - 1);
// If there is no source folder in the target folder, create a source folder if (! Directory.exists (STRFOLDERNAME)) {Directory.createdIRectory (Strtopath "//" Strfoldername);} // Create a file name String in an array save source folder [] strFiles = Directory.GetFiles (strFromPath);
// loop copy file for (int i = 0; i /// Public Static Void CopyFolder (String strfromath) {// If the source folder does not exist, create if (! Directory.exists (strFromPath)) {Directory.createdIRectory (StrFromPath); // Name String strfoldername = strFromPath.LastIndexof ("//") 1, strfromPath.length - strfromPath.LastInDexof ("/////////////////////////////////") - 1); // If there is no source folder in the target folder, create a source folder if (! Directory.exists (STRFOLDERNAME)) {Directory.createdIRectory (Strtopath "//" Strfoldername);} // Create an array save source folder String [] strFiles = Directory.GetFiles (strFromPath); // loop copy file for (int i = 0; i