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. getting data from internet

getting data from internet

Scheduled Pinned Locked Moved C#
5 Posts 5 Posters 0 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.
  • F Offline
    F Offline
    Fred 34
    wrote on last edited by
    #1

    how is it possible to get data (information) from an internet site and show it inside of my own program which is a windows form application. tnx

    OriginalGriffO P B 3 Replies Last reply
    0
    • F Fred 34

      how is it possible to get data (information) from an internet site and show it inside of my own program which is a windows form application. tnx

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      Most obvious way is to use a WebBrowser Control: MSDN[^] If that doesn't do it, what do you want to do?

      Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      1 Reply Last reply
      0
      • F Fred 34

        how is it possible to get data (information) from an internet site and show it inside of my own program which is a windows form application. tnx

        P Offline
        P Offline
        pankajupadhyay29
        wrote on last edited by
        #3

        use Web request object

        // prepare the web page we will be asking for
        HttpWebRequest request = (HttpWebRequest)
        WebRequest.Create("http://www.mayosoftware.com");

        // execute the request
        HttpWebResponse response = (HttpWebResponse)
        request.GetResponse();
        //will read data via the response stream
        Stream resStream = response.GetResponseStream();

        --Pankaj

        C 1 Reply Last reply
        0
        • P pankajupadhyay29

          use Web request object

          // prepare the web page we will be asking for
          HttpWebRequest request = (HttpWebRequest)
          WebRequest.Create("http://www.mayosoftware.com");

          // execute the request
          HttpWebResponse response = (HttpWebResponse)
          request.GetResponse();
          //will read data via the response stream
          Stream resStream = response.GetResponseStream();

          --Pankaj

          C Offline
          C Offline
          Cardon Fry
          wrote on last edited by
          #4

          If I am understanding the question right he will also need a GetStringInBetween method.

          public static string[] GetStringInBetween(string strBegin, string strEnd, string strSource, bool includeBegin, bool includeEnd)
          {
          string[] result = { "", "" };
          int iIndexOfBegin = strSource.IndexOf(strBegin);
          if (iIndexOfBegin != -1)
          {
          if (includeBegin)
          { iIndexOfBegin -= strBegin.Length; }
          strSource = strSource.Substring(iIndexOfBegin
          + strBegin.Length);
          int iEnd = strSource.IndexOf(strEnd);

              if (iEnd != -1)
              {
                  if (includeEnd)
                  { iEnd += strEnd.Length; }
                  result\[0\] = strSource.Substring(0, iEnd);
                  if (iEnd + strEnd.Length < strSource.Length)
                  { result\[1\] = strSource.Substring(iEnd + strEnd.Length); }
              }
          }
          else
          { result\[1\] = strSource; }
          return result;
          

          }

          It is a very generic method you can find it anywhere on the internet, because why would you reinvent the wheel.

          1 Reply Last reply
          0
          • F Fred 34

            how is it possible to get data (information) from an internet site and show it inside of my own program which is a windows form application. tnx

            B Offline
            B Offline
            Bernhard Hiller
            wrote on last edited by
            #5

            And there are web services which you can use.

            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