Esempio n. 1
0
        static void welcome()
        {
            Console.WriteLine("Please specify mediawiki url (eg: server.com): ");
            serverUrl = Console.ReadLine();
            Console.WriteLine("Please specify login (leave empty for guest):");
            serverUser = Console.ReadLine();
            if (!String.IsNullOrEmpty(serverUser))
            {
                Console.WriteLine("Please specify password:"******"Connecting to " + serverUrl + " ..");

            Wiki w;

            try
            {
                w = new Wiki("http://" + serverUrl);
                if (!String.IsNullOrEmpty(serverUser))
                {
                    if (!w.Login(serverUser, serverPassword))
                    {
                        Console.WriteLine("ERROR: Can not login with specified credentials.");
                        Console.ReadLine();
                        return;
                    }
                }
            }
            catch (System.Net.WebException)
            {
                Console.WriteLine("ERROR: Can not connect to specified host.");
                Console.ReadLine();
                return;
            }

            Console.WriteLine("Mediawiki connected, version: " + w.Capabilities.Version);
            Console.WriteLine("Is logged in: " + w.IsLoggedIn());

            Console.WriteLine("Ready to mount, press ENTER key ..");
            Console.ReadLine();

            Console.WriteLine("Mounting remote FS to R:");

            w = null;
            mountFS();
        }