Instance a class at runtime

  • Thread starter Thread starter Ernesto Díaz
  • Start date Start date
E

Ernesto Díaz

Hi

I need to instance a class at runtime, at runtime I can get the name in a
string, i would like to know if its possible to instance the class at
runtime with the name in a string.

Thanks for your assistance.

Ernesto Díaz
 
Ernesto,
You can use the Activator.CreateInstance or you can use reflection the get
the constructor and invoke it.
 
Does anybody have an example to help me understand ?

Thanks

Ernesto Díaz
 

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