天天看点

c#动态方法

c#根据一个传入的字符串得到需要使用的类

Type yourType =

Type.GetType("System.Web.UI.WebControls.Label");

Object yourLabel = Activator.CreateInstance(yourType);