Basic operations on the Directory class in System.IO

xiaoxiao2021-03-06  102

// Create a directory Directory.createdIRectory ("C: // Dir_name");

// Delete the directory Directory.delete ("C: // Dir_Name"); // or Directory.delete ("C: // Dir_Name", false); // When there is a file or subdirectory in the deleted directory, throw Exception, unless the second parameter is TRUE

// Judgment whether a directory is RESPONSE.WRITE (Directory.exists ("C: // Dir_Name");

// Time to get the directory response.write (Directory.getCreationTime);

/ / Returns the subdirectory string [] F1; F1 = Directory.getDirectories); // can also be written as F1 = Directory.getDirectories ("c: //", "w * * "); // E use both wildcard as conditional filtering this example is a directory that returns to the head

// Output for (int i = 0; i "); // Renewal}

// Return file F1 = Directory.getFiles in a directory ("c: //"); // can also be written as F1 = Directory.getFiles ("c: //", "w *. *"); / / E use both wildcard as conditional filtration This example is a file that is started with W

// Output for (int i = 0; i "); // Renewal}

转载请注明原文地址:https://www.9cbs.com/read-125000.html

New Post(0)