WebResponse and WebRequest
<p>I Have this code</p>

<p>// Web request section</p>

<pre><code>private static WebRequest Web_request(string ip)
{
    WebRequest request = WebRequest.Create("http://website/");
    request.Method = "POST";
    string postData = "a=1&amp;b=2";
    byte[] byteArray = Encoding.UTF8.GetBytes(postData);
    request.ContentType = "application/x-www-form-urlencoded";
    request.ContentLength = byteArray.Length;
    Stream dataStream = request.GetRequestStream();
    dataStream.Write(byteArray, 0, byteArray.Length);
    dataStream.Close();
    return request;        
}
</code></pre>

<p>// Web response section</p>

<pre><code>private static string Web_response(WebRequest request)
{
    WebResponse response = request.GetResponse();
    Stream dataStream = response.GetResponseStream();
    StreamReader reader = new StreamReader(dataStream);
    string responseFromServer = reader.ReadToEnd();
    reader.Close();
    dataStream.Close();
    response.Close();

    return responseFromServer;
}
</code></pre>

<p>and main program    </p>

<pre><code>void Main()
{
    for (int ii = 0; ii &lt; counter; ii++)
    {
        req[ii] = Web_request(ip_ext[ii]);
    }
    for (int ii = 0; ii &lt; counter; ii++)
    {
        string domen = Web_response(req[ii]);
    }
}
</code></pre>

<p>But on the 3rd step of Web_request loop program show back the Form1 and freezes. Probably i should close something on web_request section..
any suggestions?</p>
