例如,我有一个叫做Clothing的类,它继承自Product的抽象类。C# - 如何根据字符串返回一个类型
public class Clothing : Product
{
public bool IsInSeason {get; set;}
public string Material {get; set; }
public Decimal IsFeatured { get; set; }
}
编辑: 在一个功能,我将如何能够通过字符串“服装”,并有一个typeof运算类返回?
ReturnTypeOfClassBasedOffOfString(string class)
{
// ...
}
是你的问题解决了? – 2011-06-13 16:51:42