Results 1 to 6 of 6

Thread: Strange Site

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Strange Site

    buffer1 = webClient.DownloadString("http://google.com") 'this code is not problematic just for testing

    'buffer1 = webClient.DownloadString("http://api.bodis.com/domainclassification?domain=" + CurrentBlog.Domain)

    For i = 1 To 10 'just to show the bug not trying to abuse or anything
    buffer1 = webClient.DownloadString("http://api.bodis.com/domainclassification?domain=" + CurrentBlog.Domain) 'This code will break when i =2
    Next

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Strange Site

    What do you mean with "this code will break"?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Re: Strange Site

    At i=2 I got exception. Just try it.

    Code:
    buffer1 = webClient.DownloadString("http://google.com") 'this code is not problematic just for testing
    
    'buffer1 = webClient.DownloadString("http://api.bodis.com/domainclassification?domain=helloworld.com")
    
    For i = 1 To 10 'just to show the bug not trying to abuse or anything
    buffer1 = webClient.DownloadString("http://api.bodis.com/domainclassification?domain=helloworld.com") 'This code will break when i =2
    Next

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Strange Site

    The problem is with the server you're communicating with. I tried your code and and got a WebException telling me that the server committed a protocol violation. I tried again with Google in the loop and it worked fine. I don't know why that error occurs but it's the server, not the code, that has the issue.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Re: Strange Site

    JM again to the rescue I can keep accessing the site if I use webbrowser. So why I can do that with webbrowser but not webclient is beyond me.

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Strange Site

    What happens if you use a different WebClient object each time?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width