Tout est dans le titre, je suis perplexe sur la difference entre ces 2 fonctions et surtout j'aimerais savoir quand utiliser plutôt l'un que l'autre
Merci par avance
Version imprimable
Tout est dans le titre, je suis perplexe sur la difference entre ces 2 fonctions et surtout j'aimerais savoir quand utiliser plutôt l'un que l'autre
Merci par avance
Je me réponds à moi-même:
Citation:
“The difference between the two keywords is that CType succeeds as long as there is a valid conversion defined between the expression and the type, whereas DirectCast requires the run-time type of an object variable to be the same as the specified type. If the specified type and the run-time type of the expression are the same, however, the run-time performance of DirectCast is better than that of CType.”