c# or VB.net About casting an object into a datatype -


is there way able cast object depending on whats datatype written string after instanciating through relfection? example:

string datatype = "list<genericclassname>"; list<genericclassname> o = (datatype)dynamicallyinstantiateclass("namespace.classname"); 

of course can :

   dynamic d = activator.createinstance("assemblyname","typename");    d.dosomthing(); 

to find assembly name right click on projects own's class in application tab can find type assembly name


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -