using System;
class Class1
{
static void Main(string[] args)
{
string path = System.IO.Directory.GetCurrentDirectory();
string filter = "*.exe";
PrintFileSystemEntries(path);
PrintFileSystemEntries(path, filter);
GetLogicalDrives();
GetParent(path);
Move("C:\\proof", "C:\\Temp");
}
static void PrintFileSystemEntries(string path)
{
string[] directoryEntries = System.IO.Directory.GetFileSystemEntries(path);
foreach (string str in directoryEntries)
{
System.Console.WriteLine(str);
}
}
static void PrintFileSystemEntries(string path, string pattern)
{
string[] directoryEntries = System.IO.Directory.GetFileSystemEntries(path, pattern);
foreach (string str in directoryEntries)
{
System.Console.WriteLine(str);
}
}
static void GetLogicalDrives()
{
string[] drives = System.IO.Directory.GetLogicalDrives();
foreach (string str in drives)
{
System.Console.WriteLine(str);
}
}
static void GetParent(string path)
{
System.IO.DirectoryInfo directoryInfo = System.IO.Directory.GetParent(path);
System.Console.WriteLine(directoryInfo.FullName);
}
static void Move(string sourcePath, string destinationPath)
{
System.IO.Directory.Move(sourcePath, destinationPath);
System.Console.WriteLine("The directory move is complete.");
}
}