[CSharp.net] Unterschied zwischen typeof und Type.GetType?
Christoph Wille
csharp.net at glengamoi.com
Thu, 25 Nov 2004 22:24:09 +0100
Vergleich mal mit .GetType("System.Int32")
Chris
At 10:19 PM 11/25/2004, you wrote:
> > An sich ist typeof() nix anderes als ein C# Shortcut auf
> > .GetType() Methode
> > eines beliebigen Objekts.
>
>habe noch ein wenig getestet:
>
>ich kann typeof(int) mit typeof(int) vergleichen
>und bekomme true oder Type.GetType("int") mit
>Type.GetType("int"), aber nicht gegeneinander.
>
>Ich habe jetzt noch in der MSDN geguckt, da steht bei typeof
>folgendes:
>The typeof operator is used to obtain the System.Type object for a type.
>
>Bei .GetType steht:
>Gets the Type with the specified name.
>
>Letztlich sind das aber doch beides Objekte vom
>Typ Type (lt. MSDN).
>
>Verwirrung macht sich breit.
>
>Gruss
>
>Alex