14
Vérification de type: typeof, GetType, ou est?
J'ai vu beaucoup de gens utiliser le code suivant: Type t = typeof(obj1); if (t == typeof(int)) // Some code here Mais je sais que tu peux aussi faire ça: if (obj1.GetType() == typeof(int)) // Some code here Ou ca: if (obj1 is int) // Some code here Personnellement, je …