class Program
{
static void Main(string[] args)
{
MyClass m = new MyClass();
m.tt = typeof(Program);
m.test2();
}
}
[Serializable]
class MyClass
{
public Type tt { get; set; }
public int userid { get; set; }
public string Name { get; set; }
public string test2()
{
// test1<T>();
我希望使用的是从外边传过来的类型tt来调用test1范型方法
}
public string test1<T>()
{
return typeof(T).ToString();
}
}