public struct TC
{
public string name;
public string ps;
public string[] array;
}
Type structType = _assembly.GetType("lassLibrary1Demo.TC");
object structInstance = _assembly.CreateInstance("lassLibrary1Demo.TC");
PropertyInfo info = structType.GetProperty("name");
info.SetValue(structInstance, "测试结构赋值", null);
string classAttribute = (string)tp.InvokeMember("name", BindingFlags.DeclaredOnly | BindingFlags.Public
| BindingFlags.NonPublic | BindingFlags.Instance
| BindingFlags.GetProperty, null, tmpobj, null);
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。