Ejemplo n.º 1
0
        public static void Demo()
        {
            Scrape myScrape = new Scrape();
            string value    = myScrape.ScrapeWebpage("https://en.wikipedia.org/wiki/John_Cleese");

            Console.WriteLine(value);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Scrape myScrape = new Scrape();
            string value    = myScrape.ScrapeWebpage("http://msdn.microsoft.com");

            Console.WriteLine(value);
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            Scrape myScrape = new Scrape();
            string value    = myScrape.ScrapeWebpage("http://www.google.com.br");

            Console.WriteLine(value);
            Console.ReadLine();
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            Scrape scrape = new Scrape();
            string value  = scrape.ScrapeWebpage("http://msdn.microsoft.com");

            Console.WriteLine(value);
        }
Ejemplo n.º 5
0
        //to access parts of the .net framework class library.
        //1. right click references in the solution explorer and add reference.
        //2. Nuget
        //-----
        //Make our own class library to reference, here we scraped a web page and wrote it to a file.
        static void Main(string[] args)
        {
            Scrape myScrape = new Scrape();
            string result   = myScrape.ScrapeWebpage("http://www.msdn.microsoft.com", @"C:\Users\asus\Desktop\Programming\CSharp\learncs\ReferenceToAssembly\WriteText.txt");

            Console.WriteLine(result);
            Console.ReadLine();
        }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            // be sure to set ScrapClient as StartUp Project to run
            Scrape myScrape = new Scrape();
            string value    = myScrape.ScrapeWebpage("http://msdn.microsoft.com");

            Console.WriteLine(value);
            Console.ReadLine();
        }
Ejemplo n.º 7
0
        static void Main(string[] args)
        {
            Scrape myScarpe = new Scrape();

            string value = myScarpe.ScrapeWebpage("https://graph.facebook.com/youtube?access_token=EAACW5Fg5N2IBADv8LvWFIqMyj51WODAKdQhnH7B83ZBZB9RwxBrN79TJZAcI2YuBYzE9psjn7btYceQFCu5nTmAkRNqFXDPi63LzjziYx86DEoZBVNnFIhGdw1rWc0YrEW2Hqj4ajdT9uOAifTIkiM4GAPWSZA7OJJqTsLbXYduZCCupH6Fot6");

            Console.WriteLine(value);
            Console.ReadLine();
        }
Ejemplo n.º 8
0
        static void Main(string[] args)
        {
            Scrape myScrape = new Scrape();
            //string value = myScrape.ScrapeWebpage("http://msdn.microsoft.com");
            string value = myScrape.ScrapeWebpage("http://msdn.microsoft.com", @"c:\users\public\testfolder\html2.txt");

            Console.WriteLine(value);
            Console.ReadLine();
        }
Ejemplo n.º 9
0
        static void Main(string[] args)
        {
            // because we added a reference to this file, we can now use MyCodeLibrary
            // now we can use classes/methods from this namespace
            Scrape myScrape = new Scrape();
            string value    = myScrape.ScrapeWebpage("https://docs.microsoft.com/en-us/");

            Console.WriteLine(value);
        }
Ejemplo n.º 10
0
        static void Main(string[] args)
        {
            //added reference to "MyCodeLibrary.dll" from the release folder to use
            //it in our project (referencing just copied the library file to the bin directory of my project)
            Scrape myScrape = new Scrape();  //Creating instance of Scrape class
            string value    = myScrape.ScrapeWebpage("http://msdn.microsoft.com");

            Console.WriteLine(value);
            Console.ReadLine();
        }
Ejemplo n.º 11
0
        static void Main(string[] args)
        {
            Console.WriteLine("teste Scrape!! \n");

            Scrape myscrape = new Scrape();
            string v        = myscrape.ScrapeWebpage("https://pt.wikipedia.org/wiki/C_Sharp");

            Console.WriteLine(v);
            Console.ReadLine();
        }
Ejemplo n.º 12
0
        // https://youtu.be/FUGHOY3ApeU?list=PLm-PcOa0HEDbnEdssI8lFgeY9NjI9u6RN&t=15
        // 19 Creating And Adding References To Assemblies

        public static void printLesson()
        {
            // took me some time getting this working with the .dll
            // It's important to start a new project and not click on this project, add, new item, class. That's not the same as a proper Class Libary (.NET Framework)
            Scrape myScrape = new Scrape();
            string value    = myScrape.ScrapeWebpage("http://msdn.microsoft.com");

            Console.WriteLine(value);
            Console.ReadLine();
        }
Ejemplo n.º 13
0
        static void Main(string[] args)
        {
            // on reference tab click add reference and search for code library dll in bin folder
            Scrape myScrape = new Scrape();
            string value    = myScrape.ScrapeWebpage("http://msdn.microsoft.com");


            Console.WriteLine(value);

            Console.ReadLine();
        }
Ejemplo n.º 14
0
        static void Main(string[] args)
        {
            Scrape myScrape = new Scrape();
            string filepath = "My text.txt";
            string url      = "http://isitfridayyet.net";

            //string reply= myScrape.ScrapeWebpage(url);
            string reply = myScrape.ScrapeWebpage(url, filepath);

            Console.WriteLine(reply);
            Console.ReadLine();
        }
Ejemplo n.º 15
0
        static void Main(string[] args)
        {
            Console.WriteLine("Prefer to read the jumbled jargon behind a webpage instead"
                              + " of that ridiculously readable format?");

            Console.WriteLine("Here's the answer to all your problems.");

            Console.WriteLine("Copy a URL here:");

            string userInput = Console.ReadLine();

            Scrape myScrape = new Scrape();

            string value = myScrape.ScrapeWebpage(userInput);

            //sample hardcoded instead of user Input
            //string value = myScrape.ScrapeWebpage("https://msdn.microsoft.com/en-us/");

            Console.WriteLine(value);
            Console.ReadLine();
        }
Ejemplo n.º 16
0
        static void Main(string[] args)
        {
            //string text = "I want to write THIS to my file.";

            //File.WriteAllText(@"C:\ExampleOfWritingInFile\WriteText.txt", text);



            //WebClient client = new WebClient();
            //string reply = client.DownloadString("https://www.shortwalk.app/");

            //Console.WriteLine(reply);
            //System.IO.File.WriteAllText(@"C:\ShortWalkHTML\HTML.txt", reply);


            Scrape myScrape = new Scrape();
            string value    = myScrape.ScrapeWebpage("https://www.shortwalk.app/");

            Console.WriteLine(value);

            Console.ReadLine();
        }
Ejemplo n.º 17
0
        static void Main(string[] args)
        {
            for (int i = 0; i < 10; i++)
            {
                k = i.ToString();
            }
            ScopeMethod();

            /*
             * Car myCar = new Car();
             * myCar.Make = "Opel";
             * myCar.Model = "Astra";
             * myCar.Year = 2007;
             * myCar.Color = "Blue";
             *
             * Console.WriteLine("{0} {1} {2} {3}", myCar.Make, myCar.Model, myCar.Year, myCar.Color);
             *
             * //decimal value = DetermineMarketValue(myCar);
             * //Console.WriteLine("{0:C}", value);
             *
             * Console.WriteLine("{0:C}", myCar.DetermineMarketValue());
             * Console.ReadLine();
             */

            Car mySecondCar = new Car("Volvo", "V40", 2007, "Navey");

            Console.WriteLine("{0} {1} {2} {3}", mySecondCar.Make, mySecondCar.Model, mySecondCar.Year, mySecondCar.Color);

            Car.MyMethod();
            mySecondCar.ReturnContentFromPrivateMethod("Beetal");

            Scrape myScrape = new Scrape();
            string value    = myScrape.ScrapeWebpage("https://www.google.ie");

            Console.WriteLine(value);
            Console.ReadLine();
        }