instantiating an object from string value

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

Hi all

I would like to instantiate an object from a string value. if, for example,
i have a "Accounts.Account" class, how would i use that string to create
that object?

normally you would have
Accounts.Account accObj = new Accounts.Account();

i would like to accomplish the same as the above, but with the string.

trying to build a generalised winform that can instantiate one of many
classes.

Thanks
Jason
 
Jason said:
I would like to instantiate an object from a string value. if, for example,
i have a "Accounts.Account" class, how would i use that string to create
that object?

normally you would have
Accounts.Account accObj = new Accounts.Account();

i would like to accomplish the same as the above, but with the string.

trying to build a generalised winform that can instantiate one of many
classes.

See http://www.pobox.com/~skeet/csharp/faq/#create.instance
 
Back
Top