コード例 #1
0
        static void Main(string[] args)
        {
            string path = @"C:\";
            bool   end  = false;

            WriteLine("Input 'Info' to see the menu.");
            do
            {
                ConsoleFunctions.ShowMenu(ref path, ref end);
            } while (!end);
            ReadKey();
        }
コード例 #2
0
        public static void ShowMenu(ref string path, ref bool end)
        {
            string menu = ReadLine();

            switch (menu)
            {
            case "Info":
                MenuOption();
                break;

            case "DiscInformation":
                DiscInfo();
                break;

            case "ShowDirCont":
                ConsoleFunctions.DirectoryContent(path);
                break;

            case "GoToSpecificDir":
                ConsoleFunctions.GoToSpecificDirectory(ref path);
                break;

            case "GoToNextDir":
                ConsoleFunctions.GoToNextDirectory(ref path);
                break;

            case "CreateFolder":
                ConsoleFunctions.CreateFolder(path);
                break;

            case "CopyDirectory":
                ConsoleFunctions.CopyDirectory(path);
                break;

            case "DeleteDirectory":
                ConsoleFunctions.DeleteDirectory(path);
                break;

            case "MoveDirectory":
                ConsoleFunctions.MoveDirectory(path);
                break;

            case "Exit":
                end = true;
                break;

            default:
                WriteLine("Unknown command");
                break;
            }
        }