using System;
using System.Collections.Generic;
public class Program
{
public static void Main()
{
Stack s = new Stack();
Type t = s.GetType();
foreach(Type types in t.GetGenericArguments())
{
System.Console.WriteLine(
"Type parameter: " + types.FullName);
}
// ...
}
}