OK. (to be all clean, i start a new post)
this is my new download function:
Code:
static private string Download(string url)
{
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
req.Method = "GET";
WebResponse respon = req.GetResponse();
Stream res = respon.GetResponseStream();
string ret = "";
byte[] buffer = new byte[1024];
int read = 0;
while ((read = res.Read(buffer, 0, buffer.Length)) > 0)
{
ret += Encoding.ASCII.GetString(buffer, 0, read);
}
return ret;
}
the error occurs less often, but still.
this line:
Code:
WebResponse respon = req.GetResponse();
the application hangs exactly there.