sTypeName = ... //do some string stuff here to get the name of the type
/*
The Assembly.CreateInstance function returns a type
of System.object. I want to type cast it to
the type whose name is sTypeName.
assembly.CreateInstance(sTypeName)
So, in effect I want to do something like:
*/
assembly.CreateInstance(sTypeName) as Type.GetType(sTypeName);
Come si fa? E, cosa prendo sul lato sinistro dell'espressione di assegnazione, supponendo che questo sia C# 2.0. Non ho la parola chiave var.Tipizzato a un tipo solo dalla rappresentazione di stringa del nome del tipo
Grazie, avevo già fatto (2) e stavo cercando le opzioni. –