Wednesday, September 15, 2010

C# Dynamically create instance of object from string

String typeName = "Yournamespace.yourclassname";
Object obj = Activator.CreateInstance(Type.GetType(typeName));

No comments:

Post a Comment