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
It depends on what I'm doing. If I need a bool value (say, to determine if I'll cast to an int), I'll use is. If I actually need the type for some reason (say, to pass to some other method) I'll use GetType().
is
GetType()