1
Reply

What is the difference between typeof() and GetType()?

Jul 26, 2006
12.2k
0

    // Obtain type information from a variable.
    SomeType c = new SomeType();
    Type t = c.GetType();
    INeedYourTypeInfo(t);

    // Obtain type information via typeof.
    INeedYourTypeInfo(typeof(SomeType));

    Kiran Babu
    July 26, 2006
    0