I\'ve seen many people use the following code:
Type t = typeof(obj1); if (t == typeof(int)) // Some code here
But I know you could also
The last one is cleaner, more obvious, and also checks for subtypes. The others do not check for polymorphism.