开发者

C#.NET: How do I create a new instance of a class based solely on a "Type" object?

开发者 https://www.devze.com 2023-01-30 19:14 出处:网络
Example: public static System.Object CreateInstance ( System.Type t ) { // return t.<CreateNe开发者_如何学CwObject>;

Example:

public static System.Object CreateInstance ( System.Type t )
{
    // return t.<CreateNe开发者_如何学CwObject>;
}


You want Activator.CreateInstance(t)

0

精彩评论

暂无评论...
验证码 换一张
取 消