Presuming I have the strings "List" and "Socket," how would I go about creating a List<Socket>?
The answer I need will work just as well for Queue and XmlNodeList, not to mention MyCustomGeneric with MyCustomClass.
From stackoverflow
-
Would this answer your question?
http://stackoverflow.com/questions/687363/how-do-i-create-a-generic-class-from-a-string-in-c
-
Type t=Type.GetType("System.Collections.Generic.List`1[System.Net.Sockets.Socket]"); object o=Activator.CreateInstance(t);
0 comments:
Post a Comment