=?Utf-8?B?TWFuZGFy?= <an*******@discussions.microsoft.com> wrote:
How do i instantiate a class if I get the name of the class at runtime ?
I am looking for something like class.forname("classABC") in Java .
Well, Type.GetType is roughly the equivalent of Class.forName, but
Activator.CreateInstance is roughly the equivalent of
Class.newInstance.
Note that in order to get a Type object for a type in an assembly other
than either the calling one or mscorlb, you need to either load the
assembly yourself and use Assembly.GetType, or include the full name of
the type including assembly information in the call to Type.GetType.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too