I want to know is there any difference between destructor and garbage collector, destructor is used to dispose of all unused objects at the end of the lifetime of the applic
The garbage collector is a part of the .NET environment that keeps track of objects and makes sure that objects are removed from memory when they are no longer needed.
A destructor is a part of a class design. It's the opposite of a constructor. When you declare it the GC will call it when it destroys an object.
Here is the MSDN documentation.