Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Take data from a website and display in a program.

Take data from a website and display in a program.

Scheduled Pinned Locked Moved C#
csharpdatabaselearning
7 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    malcomhfc
    wrote on last edited by
    #1

    So i've slowly been learning c# over few months but going slow and is my first language. One thing i would like to know, is how it would get a c# program to take data from a website then display inside the application. (Not taking data from a database) Could anyone possible point be at examples or tell me roughly what i would have to do. Thanks in advance, Malcom

    L G 2 Replies Last reply
    0
    • M malcomhfc

      So i've slowly been learning c# over few months but going slow and is my first language. One thing i would like to know, is how it would get a c# program to take data from a website then display inside the application. (Not taking data from a database) Could anyone possible point be at examples or tell me roughly what i would have to do. Thanks in advance, Malcom

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, there are a couple of ways to do that: 1. add a WebBrowser to your form, make it navigate to your URL, then grab its DocumentText. You could do that with a hidden WebBrowser as well. 2. use HttpRequest and HttpResponse classes to access the web yourself. This is faster, but a bit more complex. FWIW: make sure to study a good book[^] on C# :)

      Luc Pattyn

      :badger: :jig: :badger:

      Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.

      :jig: :badger: :jig:

      M 1 Reply Last reply
      0
      • L Luc Pattyn

        Hi, there are a couple of ways to do that: 1. add a WebBrowser to your form, make it navigate to your URL, then grab its DocumentText. You could do that with a hidden WebBrowser as well. 2. use HttpRequest and HttpResponse classes to access the web yourself. This is faster, but a bit more complex. FWIW: make sure to study a good book[^] on C# :)

        Luc Pattyn

        :badger: :jig: :badger:

        Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.

        :jig: :badger: :jig:

        M Offline
        M Offline
        malcomhfc
        wrote on last edited by
        #3

        Yeah i have heard of HttpRequest and Response. I didn't want to use a browser. So on return of the data it is possible to display it differently. For example come up in a textbox or different controls im not really thinking of just now. Thanks for the book recommendation, i'm looking for the best one at Amazon :)

        L 1 Reply Last reply
        0
        • M malcomhfc

          Yeah i have heard of HttpRequest and Response. I didn't want to use a browser. So on return of the data it is possible to display it differently. For example come up in a textbox or different controls im not really thinking of just now. Thanks for the book recommendation, i'm looking for the best one at Amazon :)

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          the response is always a string, it is a text following HTML conventions. :)

          Luc Pattyn

          :badger: :jig: :badger:

          Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.

          :jig: :badger: :jig:

          M 1 Reply Last reply
          0
          • L Luc Pattyn

            the response is always a string, it is a text following HTML conventions. :)

            Luc Pattyn

            :badger: :jig: :badger:

            Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.

            :jig: :badger: :jig:

            M Offline
            M Offline
            malcomhfc
            wrote on last edited by
            #5

            Thanks for the help :)

            L 1 Reply Last reply
            0
            • M malcomhfc

              Thanks for the help :)

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              You're welcome. :)

              Luc Pattyn

              :badger: :jig: :badger:

              Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.

              :jig: :badger: :jig:

              1 Reply Last reply
              0
              • M malcomhfc

                So i've slowly been learning c# over few months but going slow and is my first language. One thing i would like to know, is how it would get a c# program to take data from a website then display inside the application. (Not taking data from a database) Could anyone possible point be at examples or tell me roughly what i would have to do. Thanks in advance, Malcom

                G Offline
                G Offline
                Gindi Bar Yahav
                wrote on last edited by
                #7

                You can use ADO.NET to create database for the website, and then connect to it with the C# application. or you can do someting that call "web service" - open new ASP.NET Web service in your Visual Stduio, there, you can define methods that after you can call to then with your C#. after you finish define, go to the C# project, and then on the solution explorer->referance of the project click left mouse, click "Web referance", and look for your web service address, then you can use all the methods you defined.

                Gindi Bar Yahav - Web & Software developer.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups