Esempio n. 1
0
        } // end DisplayMenu()

        public static bool GetResponce(String username, String password, String server)
        {
            string getAnswer = "";
            bool   MyAnswer  = true;

            getAnswer = Console.ReadLine();
            ServerConnectionInformation conn = new ServerConnectionInformation(username, password, server);

            switch (getAnswer)
            {
            case "9":
                Console.WriteLine(" Not Implemented Yet \n");
                //Log out -> set to true
                MyAnswer = false;
                break;

            case "8":
                Console.WriteLine(" Not Implemented Yet  \n");
                MyAnswer = false;
                break;

            case "7":
                Console.WriteLine(" Not Implemented Yet  \n");
                //Rename remote file
                MyAnswer = false;
                break;

            case "6":
                Console.WriteLine(" Not Implemented Yet  \n");
                //Change file permissions
                MyAnswer = false;
                break;

            case "5":
                Console.WriteLine(" Not Implemented Yet  \n");
                //Delete file on remote server
                MyAnswer = false;
                break;

            case "4":
                Console.WriteLine(" You choose 4, Create Directory:  \n");
                //create remote directory


                CreateRemoteDirectory createRemDir = new CreateRemoteDirectory(conn);
                String directory = createRemDir.getDirectoryName();
                String response  = createRemDir.create(directory);
                if (response == "success")
                {
                    Console.Write("Directory Created\n");
                }
                else if (response == "disconnect")
                {
                    //If lost connection to server, log out
                    MyAnswer = true;
                    break;
                }
                else
                {
                    Console.Write("Could not create directory due to an error.\n" + response + "\n");
                }
                MyAnswer = false;
                break;

            case "3":
                Console.WriteLine(" Not Implemented Yet \n");
                //list remote directory
                MyAnswer = false;
                break;

            case "2":
                Console.WriteLine(" Not Implemented Yet \n");
                MyAnswer = false;
                break;

            case "1":
                Console.WriteLine(" Not Implemented Yet  \n");
                //File upload
                break;

            default:
                Console.WriteLine("\n That was not a valid input, Please try again \n");
                //File download
                break;
            }
            return(MyAnswer);
        } // end getResponce()
Esempio n. 2
0
 //A constructor for the class which takes in a ServerconnectionInformation to set up for its use.
 public CreateRemoteDirectory(ServerConnectionInformation toUse)
 {
     this.connection = toUse;
 }