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. HTTP GetResponse problem

HTTP GetResponse problem

Scheduled Pinned Locked Moved C#
csharpperlhelpquestion
4 Posts 3 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.
  • K Offline
    K Offline
    ke5in
    wrote on last edited by
    #1

    I’m trying to scrape a site but I’m having a problem. My program works for 4 iterations and then stops. I ported this code, line for line, over to Perl and it works fine. I stepped through the C# code and found that it hangs on this line: objStream = wrGETURL.GetResponse().GetResponseStream(); But it only hangs on the fifth time, it works for the first four times. This is baffling me, so I'm hoping one of you guys can figure out what is wrong.

    R F 2 Replies Last reply
    0
    • K ke5in

      I’m trying to scrape a site but I’m having a problem. My program works for 4 iterations and then stops. I ported this code, line for line, over to Perl and it works fine. I stepped through the C# code and found that it hangs on this line: objStream = wrGETURL.GetResponse().GetResponseStream(); But it only hangs on the fifth time, it works for the first four times. This is baffling me, so I'm hoping one of you guys can figure out what is wrong.

      R Offline
      R Offline
      Rocky Moore
      wrote on last edited by
      #2

      Try an "objReader.Close();" before it goes out of scope. (If this message is posted twice, sorry.. CP gives me all kinds of fits about posting message. It errors out about 50% of the time. Never know if it got posted until I see them actually appear.) Rocky Moore <><

      K 1 Reply Last reply
      0
      • K ke5in

        I’m trying to scrape a site but I’m having a problem. My program works for 4 iterations and then stops. I ported this code, line for line, over to Perl and it works fine. I stepped through the C# code and found that it hangs on this line: objStream = wrGETURL.GetResponse().GetResponseStream(); But it only hangs on the fifth time, it works for the first four times. This is baffling me, so I'm hoping one of you guys can figure out what is wrong.

        F Offline
        F Offline
        firat kocak
        wrote on last edited by
        #3

        Hi, I run your code. In my first trial , after a time , it seemed to be stopped. Yes it was at index 4. Later i decided to debug your code and it worked well. Later i made it run without debugging, guess, it worked well again. That means that there doesn't seem to be a code problem. Cheers, Doing something is better than doing nothing. So ... Move !

        1 Reply Last reply
        0
        • R Rocky Moore

          Try an "objReader.Close();" before it goes out of scope. (If this message is posted twice, sorry.. CP gives me all kinds of fits about posting message. It errors out about 50% of the time. Never know if it got posted until I see them actually appear.) Rocky Moore <><

          K Offline
          K Offline
          ke5in
          wrote on last edited by
          #4

          Thanks Rocky, That did the trick.

          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