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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. WebRequest.GetResponse()

WebRequest.GetResponse()

Scheduled Pinned Locked Moved C#
questioncsharpcomhelp
2 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.
  • M Offline
    M Offline
    mikker_123
    wrote on last edited by
    #1

    class Class1 { [STAThread] static void Main(string[] args) { WebRequest req = WebRequest.Create("http://www.google.com"); // hangs here WebResponse resp = req.GetResponse(); resp.Close(); } } Question is simple -> how come my code hangs on second line? I tried it on two computers (.NET 1.1) and it won't work. After some time I get WebException (The operation has timed-out). Any help is greatly appreciated.

    G 1 Reply Last reply
    0
    • M mikker_123

      class Class1 { [STAThread] static void Main(string[] args) { WebRequest req = WebRequest.Create("http://www.google.com"); // hangs here WebResponse resp = req.GetResponse(); resp.Close(); } } Question is simple -> how come my code hangs on second line? I tried it on two computers (.NET 1.1) and it won't work. After some time I get WebException (The operation has timed-out). Any help is greatly appreciated.

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Use a HttpWebRequest to start with: HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://www.google.com"); --- b { font-weight: normal; }

      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