Esempio n. 1
0
        public static void Main(string[] args)
        {
            // Set up logger depending on OS
            term = (Util.IsLinux() ? (ITerminal) new LinTerminal() : new WinTerminal());
            term.Init();

            term.WriteLine(@"+---------------------------------------+");
            term.WriteLine(@"| Revolutionize web development with C# |");
            term.WriteLine(@"+---------------------------------------+");
            term.WriteLine(@"|  _   _      _     _   _  _____ _____  |");
            term.WriteLine(@"| | \ | |    | |   | \ | ||  ___|_   _| |");
            term.WriteLine(@"| |  \| | ___| |_  |  \| || |__   | |   |");
            term.WriteLine(@"| | . ` |/ _ \ __| | . ` ||  __|  | |   |");
            term.WriteLine(@"| | |\  |  __/ |_ _| |\  || |___  | |   |");
            term.WriteLine(@"| \_| \_/\___|\__(_)_| \_/\____/  \_/   |");
            term.WriteLine(@"+---------------------------------------+");
            term.WriteLine(@"|   An open source  project by Inskey   |");
            term.WriteLine(@"+---------------------------------------+");

            Logger.SetTerminal(term);
            Logger.Log("Terminal set up for " + (Util.IsLinux() ? "Linux" : "Windows") + ".");

            // Load all the pages
            Logger.Log("Loading pages...");
            short amount = LoadPages();
            Logger.Log("Loaded " + amount + " pages.");

            // Load all the resources
            Logger.Log("Loading resources...");
            amount = LoadResources();
            Logger.Log("Loaded " + amount + " resources.");

            // Load special pages, or copy them to the filesystem if they don't exist
            //Logger.Log("Loading special pages...");
            //LoadSpecials();
            //Logger.Log("All specials loaded.");

            // Start listening for HTTP connections
            listener = new Listener();
            listener.Open();

            // Main thread becomes the command line thread
            ConsoleLoop();
        }