'dynamic' class

  • Thread starter Thread starter nieuws
  • Start date Start date
N

nieuws

Hello,
I have a variable containing a classname and want to use that variable to
create an instance of the class. Is that possible? How?
string classvar = "xyz"
object class = new classvar --> creates an instance of class xyz

Thanks in advance

Frank
 
Hi,

Use the Activator.CreateInstance method.

Specifically, the (string, string) overload might be the one you are
searching for.

HTH,
Rakesh Rajan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top