FtpWebResponse implements IDisposable, but it doesn't have a Dispose method. How is that possible?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
It's implemented in the base class WebResponse
alt text http://img227.imageshack.us/img227/2428/redgatesnetreflector.png
It inherits from System.Net.WebResponse which implements these methods.
Its implemented in the base class WebResponse, see http://msdn.microsoft.com/en-us/library/system.net.webresponse_methods.aspx
It does have the Dispose method through inheritance, but it is an explicit implementation. To call it, you would have to use
Or, of course, just wrap it in a
using
block, as it does the explicit call for you.When you implement an
interface
explicitly, you won't get the method in the listing. You will have to cast that object to implementedinterface
to get access to that method.Reference : http://msdn.microsoft.com/en-us/library/ms173157.aspx