Clean up unmanned code in C#

Introduction The code then execute in CLR (Common Language Runtine) is called managed code. And the code execute outside the scope of CLR is known as unmanaged code. The examples of unmanaged code is COM component, some database call etc. CLR is responsible for cleanup managed code. But for clean up unmanaged code we need to do some thing extra...

Continue reading

Abstraction and Encapsulation

Definition Encapsulation is the process of hiding irrelevant data from the user. Or in other word encapsulation is a process of hiding all the internal details of an object from the outside world.Abstraction is just opposite of encapsulation. Abstraction is mechanism to show only relevant data to user. Hence it is a process of representation of...

Continue reading

How to send email using C#

C# provides many built in exiting features to make developer life easy. SmtpClient class is one of them. SmtpClient has every thing that we need to send email from our application. Namespace : System.Net The following program illustrate how to send email using SmtpClient from our Asp.Net application. SmtpClient s = new SmtpClient(); s.Host =...

Continue reading

XML Serialization in C#

XML Serialization XML Serialization serialize only public fields, properties of an object and parameters and return value of a method. That is why it is called Shallow Serialization.  XML serialization results in strongly typed classes with public properties and fields that are converted to XML. System.Xml.Serialization has all the classes and...

Continue reading