creating class from string rep. of classname

creating class from string rep. of classname

Post by U2Vsa » Sun, 06 Feb 2005 00:25:03


Hi,

I wan't to create a class from a string I obtain:

eg, if

String classname= "myClass";

then I want something that is the equivalent of:

myClass m= new myClass();
 
 
 

creating class from string rep. of classname

Post by Jako Menkv » Sun, 06 Feb 2005 00:49:29

Type myType = Type.GetType(<fully qualified class name>, true)
Activator.GetObject(myType, <class name>)

Does this make sense?

 
 
 

creating class from string rep. of classname

Post by Jeff Loui » Sun, 06 Feb 2005 03:59:35

See also...
http://www.yqcomputer.com/
Regards,
Jeff
I wan't to create a class from a string I obtain:


*** Sent via Developersdex http://www.yqcomputer.com/ ***
Don't just participate in USENET...get rewarded for it!