I'm using the following code in my program, would I still need to call response.close()? Or does the FtpWebResponse IDisposable implementation close the response?
using (FtpWebResponse response = (FtpWebResponse)request.GetResponse())
{
}
So basically, would I need to do this?
using (FtpWebResponse response = (FtpWebResponse)request.GetResponse())
{
response.close();
}
No you don't have to call
Close, sinceDisposealready does that.FtpWebResponseis inherited fromWebResponseand it has explicitly implementedDispose, which internally callClose.Code for
WebResponse.csfrom : http://www.dotnetframework.org/default.aspx/4@0/4@0/DEVDIV_TFS/Dev10/Releases/RTMRel/ndp/fx/src/Net/System/Net/WebResponse@cs/1305376/WebResponse@cs