Use Object.ReferenceEquals
and GetType
Example pulled from MSDN:
int n1 = 12;
int n2 = 82;
long n3 = 12;
Console.WriteLine("n1 and n2 are the same type: {0}",
Object.ReferenceEquals(n1.GetType(), n2.GetType()));
Console.WriteLine("n1 and n3 are the same type: {0}",
Object.ReferenceEquals(n1.GetType(), n3.GetType()));
// The example displays the following output:
// n1 and n2 are the same type: True
// n1 and n3 are the same type: False
Source:http://msdn.microsoft.com/en-us/library/system.object.gettype.aspx
I may have misunderstood, however. This will check only check to see if they are the same type, two objects of the same type with different references will still evaluate to true
using this method.