He visto a muchas personas usar el siguiente código: Type t = typeof(obj1); if (t == typeof(int)) // Some code here Pero sé que también podrías hacer esto: if (obj1.GetType() == typeof(int)) // Some code here O esto: if (obj1 is int) // Some code here Personalmente, siento que el último...
1513
Comprobación de tipo: typeof, GetType o is?