Eu já vi muitas pessoas usarem o seguinte código: Type t = typeof(obj1); if (t == typeof(int)) // Some code here Mas eu sei que você também pode fazer isso: if (obj1.GetType() == typeof(int)) // Some code here Ou isto: if (obj1 is int) // Some code here Pessoalmente, sinto que o último...
1513
Verificação de tipo: typeof, GetType ou is?