WebResponse response;
try
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Timeout = 20000;
response = request.GetResponse();
request = (HttpWebRequest)WebRequest.Create(url2);
response = request.GetResponse();
}
catch(Exception ex)
{
//do something
}
finally
{
}
response.Close()应该在哪里调用?
每次try中的GetResponse()之后调用?
最后一次try中的GetResponse()之后调用一次?
- 在finally块中调用?