Last post Jun 10, 2014 09:29 AM by AidyF
Jun 10, 2014 08:41 AM|Rahul_agg11|LINK
Please tell why FileStream, Console, Connection, etc. are unmanaged object even when these classes are created in C#. Even when we create an object of a class that is also an unmanaged code.
Jun 10, 2014 09:29 AM|AidyF|LINK
System.IO.FileStream is a .net class, but the actual filestream itself isn't, it is something supplied by the operating system as an abstracted way of interacting with the hardware of the hard drive. Likewise the actual connection to your database is being
provided by non .net database drivers and libraries, and ultimately comes down to a TCP socket, named pipe or some other operating system provided cross-process communication channel. As none of these low level things are under the control of .net, they live
outside of the .net framework so need to be disposed of using their own individual native methods.