System.IDisposable is a foundational interface used in most .NET programs. Its primary purpose is to provide a mechanism for releasing “unmanaged” resources: file streams, database connections, network sockets, etc. Here’s the whole thing: