SetDefaultPage() 공개 메소드

public SetDefaultPage ( string fileName ) : void
fileName string
리턴 void
예제 #1
0
파일: Program.cs 프로젝트: RareAMV/WeebIRC
        /// <Main>
        /// <summary>
        ///  Prompts user with the options for saving a log file and printing log messages to the console window
        ///  After that, it sets the default download directory
        ///  Following it checks the current operating system, and performs actions related to the operating system, see '<RunningPlatform>'
        ///  After that, it tries to locate all already downloaded files
        ///  Then initiates the IRC client for later usage
        ///  And after all that, starts the http servers (see class for more information)
        /// </summary
        /// </Main>
        static void Main(string[] args)
        {
            Console.WriteLine("Do you want to save debug messages to a log file? (Yes/No) (Left Empty means No): ");
            string shouldSaveDebug = Console.ReadLine();

            if (shouldSaveDebug.ToLower().Contains("yes"))
            {
                saveDebug = true;
            } else{
                saveDebug = false;
            }

            Console.WriteLine("Do you want to show debug messages in console? (Yes/No) (Left Empty means No): ");

            string shouldShowDebug = Console.ReadLine();

            if (shouldShowDebug.ToLower().Contains("yes"))
            {
                showDebug = true;
            }
            else
            {
                showDebug = false;
            }

            Console.WriteLine("URL To use in your webbrowser: " + GetLocalIPAddress() + ":" + port.ToString());

            SetupDownloadDir(Directory.GetCurrentDirectory() + @"/Downloads/");

            RunningPlatform();

            GetCurrentFiles();

            irc = new SimpleIRC();

            webserver = new HttpServer(HttpMessageReceived, port);
            webserver.SetWebHomeDir(Directory.GetCurrentDirectory() + @"/Views");
            webserver.SetFileDir(Directory.GetCurrentDirectory() + "/Downloads");
            webserver.SetDefaultPage("index.html");
            streamserver = new HttpServer(HttpMessageReceived, port+1);
            streamserver.SetWebHomeDir(Directory.GetCurrentDirectory() + @"/Downloads");
            streamserver.SetFileDir(Directory.GetCurrentDirectory() + "/Downloads");
            streamserver.SetDefaultPage("index.html");

            while (true)
            {
                string toSend = Console.ReadLine();
                if(toSend != "")
                {
                    if(toSend == "curanime"){
                        ParseAnimeSeason("http://myanimelist.net/anime/season", "current");
                        Console.WriteLine("starting to parse anime!");
                    } else {
                        webserver.SendMessage(toSend);
                    }

                }
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: RareAMV/WeebIRC
        /// <Main>
        /// <summary>
        ///  Prompts user with the options for saving a log file and printing log messages to the console window
        ///  After that, it sets the default download directory
        ///  Following it checks the current operating system, and performs actions related to the operating system, see '<RunningPlatform>'
        ///  After that, it tries to locate all already downloaded files
        ///  Then initiates the IRC client for later usage
        ///  And after all that, starts the http servers (see class for more information)
        /// </summary
        /// </Main>
        static void Main(string[] args)
        {
            Console.WriteLine("Do you want to save debug messages to a log file? (Yes/No) (Left Empty means No): ");
            string shouldSaveDebug = Console.ReadLine();

            if (shouldSaveDebug.ToLower().Contains("yes"))
            {
                saveDebug = true;
            }
            else
            {
                saveDebug = false;
            }

            Console.WriteLine("Do you want to show debug messages in console? (Yes/No) (Left Empty means No): ");

            string shouldShowDebug = Console.ReadLine();

            if (shouldShowDebug.ToLower().Contains("yes"))
            {
                showDebug = true;
            }
            else
            {
                showDebug = false;
            }

            Console.WriteLine("URL To use in your webbrowser: " + GetLocalIPAddress() + ":" + port.ToString());

            SetupDownloadDir(Directory.GetCurrentDirectory() + @"/Downloads/");

            RunningPlatform();

            GetCurrentFiles();

            irc = new SimpleIRC();

            webserver = new HttpServer(HttpMessageReceived, port);
            webserver.SetWebHomeDir(Directory.GetCurrentDirectory() + @"/Views");
            webserver.SetFileDir(Directory.GetCurrentDirectory() + "/Downloads");
            webserver.SetDefaultPage("index.html");
            streamserver = new HttpServer(HttpMessageReceived, port + 1);
            streamserver.SetWebHomeDir(Directory.GetCurrentDirectory() + @"/Downloads");
            streamserver.SetFileDir(Directory.GetCurrentDirectory() + "/Downloads");
            streamserver.SetDefaultPage("index.html");

            while (true)
            {
                string toSend = Console.ReadLine();
                if (toSend != "")
                {
                    if (toSend == "curanime")
                    {
                        ParseAnimeSeason("http://myanimelist.net/anime/season", "current");
                        Console.WriteLine("starting to parse anime!");
                    }
                    else
                    {
                        webserver.SendMessage(toSend);
                    }
                }
            }
        }