示例#1
0
        static void Main(string[] args)
        {
            HTMLhandler Htmlhandler = new HTMLhandler();
            string      input;
            string      result;

            ShowInstructions();

            for (; ;)
            {
                Console.Write("\n? ");
                input = Console.ReadLine();
                if (string.IsNullOrWhiteSpace(input))
                {
                    break;
                }

                result = ShowResults(Htmlhandler, input);

                //Verifies if there is a result
                if (!string.IsNullOrEmpty(result))
                {
                    ShowSaveFile(input, result);
                }
                Console.WriteLine("\nHTMLstrip - version 0.1");
            }
        }
示例#2
0
        //Method to show the results from the HTMLstrip
        private static string ShowResults(HTMLhandler Htmlhandler, string input)
        {
            InputHandler inputHandler = new InputHandler();
            string       result;

            if (inputHandler.ValidateInput(input))
            {
                //Shows the result
                Console.WriteLine("\n\nText extracted from {0}:\n", input);
                result = Htmlhandler.StripHTML(input);
                Console.WriteLine(result);
                return(result);
            }
            Console.WriteLine("Not valid input\n");
            return(null);
        }