Gustavo

Gustavo

  • NA
  • 1.3k
  • 450.1k

How Do I: Run a Dynamic Class?

Apr 29 2010 11:18 AM

Hello:
 
This is part 2 of an issue.
 
Initially I wanted to take a TextBox value and run that class. The following code is what I have been tolod to do. It took a while to get it to compile. However, now I need to know how to run/execute the class.
TheClass = textBoxClass.Text;
Assembly TheAssembly;
TheAssembly =
Assembly.GetExecutingAssembly();
object MyDynamicClass = TheAssembly.CreateInstance("ICEPack.Class" + TheClass);
MyDynamicClass();   //<<<ERROR - How do I run the class MyDynamicClass?

Answers (7)