Directory and DirectoryInfo Class
n Directory Has Static Methods Used to:
l Create, move, and enumerate through directories
and subdirectories
n DirectoryInfo Has Instance Methods Used to:
l Create, move, and enumerate through directories
and subdirectories
l Can eliminate some security checks when reusing an object
n Example:
l Enumerating through the current directory
l
l
n
n Use Path Class Objects to Process Directory Strings
DirectoryInfo dir = new DirectoryInfo(".");
foreach (FileInfo f in dir.GetFiles("*.cs")) {
String name = f.FullName; }