1

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.

JaredPar
  • 733,204
  • 149
  • 1,241
  • 1,454
Yes - that Jake.
  • 16,725
  • 14
  • 70
  • 96

1 Answers1

0
Type t=Type.GetType("System.Collections.Generic.List`1[System.Net.Sockets.Socket]");
object o=Activator.CreateInstance(t);
laktak
  • 57,064
  • 17
  • 134
  • 164