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. .NET (Core and Framework)
  4. faster C++ .NET webclient usage?

faster C++ .NET webclient usage?

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpc++jsonquestion
3 Posts 2 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.
  • T Offline
    T Offline
    T2102
    wrote on last edited by
    #1

    The code below takes a few seconds for each thread/webpage, which is longer than accessing it from an open browser such as google chrome. Is there some setting I need to apply to make it run faster? Should I try to reuse the same webclient in each thread and consider using DownloadAsync? I am thinking that webclient might internally use technology from the slow browser internet explorer instead of google chrome for instance. Is there a public API that would let me download this with google chrome. System::Net::WebClient client; client.DownloadString(URL); //URL is a System::String^

    L 1 Reply Last reply
    0
    • T T2102

      The code below takes a few seconds for each thread/webpage, which is longer than accessing it from an open browser such as google chrome. Is there some setting I need to apply to make it run faster? Should I try to reuse the same webclient in each thread and consider using DownloadAsync? I am thinking that webclient might internally use technology from the slow browser internet explorer instead of google chrome for instance. Is there a public API that would let me download this with google chrome. System::Net::WebClient client; client.DownloadString(URL); //URL is a System::String^

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Ted2102 wrote:

      which is longer than accessing it from an open browser such as google chrome.

      That's an unfair comparison; the piece of code will always fetch the page as it is on the server, where Chrome can simply read back it's own cache.

      Ted2102 wrote:

      consider using DownloadAsync?

      That wouldn't fetch the page faster, it would only move the task to another thread. You'd still have to wait until that thread receives the entire response.

      Ted2102 wrote:

      Is there a public API that would let me download this with google chrome.

      Alas, no.

      I are Troll :suss:

      T 1 Reply Last reply
      0
      • L Lost User

        Ted2102 wrote:

        which is longer than accessing it from an open browser such as google chrome.

        That's an unfair comparison; the piece of code will always fetch the page as it is on the server, where Chrome can simply read back it's own cache.

        Ted2102 wrote:

        consider using DownloadAsync?

        That wouldn't fetch the page faster, it would only move the task to another thread. You'd still have to wait until that thread receives the entire response.

        Ted2102 wrote:

        Is there a public API that would let me download this with google chrome.

        Alas, no.

        I are Troll :suss:

        T Offline
        T Offline
        T2102
        wrote on last edited by
        #3

        Thanks

        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