title: C# HttpWebRequest hangs program suddenly. Did not earlier
body: <p>Earlier I made an HttpWebRequest that worked perfectly fine, and my StreamReader read the HTML of the website perfectly.</p>
  
  <p>But all of the sudden, after having tested it's functionality and confirmed that it worked many times, it hangs the program when it comes to the StreamReader line.
  I have tried removing this line, and the code continued.</p>
  
  <p>The thing is; I tried inputting a different website than the one I need to use, (I put in www.google.com) and it worked perfectly fine. So my error conclusion is, that it is only the website I need to use that I can't access anymore which makes me think that the endpart (the website) is cancelling my connection or blocking me or something. BUT! The HttpWebRequest itself doesn't hang or anything, which must mean that it successfully established a request to the website?</p>
  
  <p>Enough chit-chat, here's the code:</p>
  
  <pre><code>HttpWebRequest request = (HttpWebRequest)WebRequest.Create("website here");
  MessageBox.Show("1"); //This is shown.
  string HTMLLink = (new     StreamReader(request.GetResponse().GetResponseStream())).ReadToEnd(); //This is where the     program hangs....
  MessageBox.Show("2"); //This is not shown! Below this isn't being executed.
  if (HTMLLink.Length &gt; 0)
  {
      HTMLLink = HTMLLink.Substring(HTMLLink.IndexOf("uuu"), HTMLLink.Length -     HTMLLink.IndexOf("uuu"));
      HTMLLink = HTMLLink.Substring(0, HTMLLink.IndexOf("\" TARGET="));
      request = (HttpWebRequest)WebRequest.Create(HTMLLink);
      string HTML = (new     StreamReader(request.GetResponse().GetResponseStream())).ReadToEnd();
      if (HTML.Length &gt; 0 &amp;&amp; HTML.Contains(" &lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;") &amp;&amp; HTML.Contains("    &lt;br&gt;&lt;br&gt;&lt;script "))
      {
          HTML = HTML.Substring(HTML.IndexOf(" &lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;") + 22,     HTML.IndexOf("&lt;br&gt;&lt;br&gt;&lt;script "));
          HTML = HTML.Substring(0, HTML.IndexOf("&lt;br&gt;&lt;br&gt;&lt;script "));
          HTML = HTML.Replace("\r\n", "");
          HTML = HTML.Replace("\n", "");
          HTML = HTML.Replace("&lt;br&gt;", "\r\n");
          HTML = HTML.Replace("&lt;BR&gt;", "\r\n");
          HTML = HTML.Replace("&lt;br /&gt;", "\r\n");
          HTML = HTML.Replace("&lt;BR /&gt;", "\r\n");
          textBox.Text = HTML;
      }
  }
  </code></pre>
  
  <p>And please keep in mind that it worked perfectly earlier then all of the sudden it started hanging, and that it works fine with www.google.com.</p>
  
  <p>And by the way, yes I have done many searches. No useful results.</p>
  
  <p>I have tried the timeout already, it does timeout.
  Maybe the website has blocked my program thinking it's a spider? what then? </p>
  
  <p>Everytime when I reach the StreamReader (no matter how I set it up) it starts to hang.
  And it keeps hanging, it doesn't deliver any result.
  This ONLY happens with lyrics007.com which is the exact website I need. It works fine with google.</p>
  
  <p>Help, please!</p>
  
  <p>Thanks in advance!</p>