先是新建类库生成dll文件namespace skinD
{
public class skins
{
public Image a = Properties.Resources.imga; public Image b = Properties.Resources.imgb;
}
}
然后调用 string str_namespace = "skinD";//命名空间
string str_classname = "skinD.skins";//类名
System.Reflection.Assembly assembly = System.Reflection.Assembly.Load(str_namespace);
Type ty = assembly.GetType(str_classname);
object ds = (object)System.Activator.CreateInstance(ty);
System.Reflection.FieldInfo fie = ty.GetField("a");
//----求这里怎么取得 image a的值
{
public class skins
{
public Image a = Properties.Resources.imga; public Image b = Properties.Resources.imgb;
}
}
然后调用 string str_namespace = "skinD";//命名空间
string str_classname = "skinD.skins";//类名
System.Reflection.Assembly assembly = System.Reflection.Assembly.Load(str_namespace);
Type ty = assembly.GetType(str_classname);
object ds = (object)System.Activator.CreateInstance(ty);
System.Reflection.FieldInfo fie = ty.GetField("a");
//----求这里怎么取得 image a的值
http://topic.csdn.net/u/20071121/10/f3e97633-d156-4eda-9002-5e89513a2c22.html
Image img = fie.GetValue(ds) as Image;