using System; using System.Reflection; using System.Diagnostics; using System.Runtime.InteropServices; namespace Field { struct Test { public float X; } class MainClass { ; Stopwatch m_StopWatch = new Stopwatch(); Test m_Test; object m_Target; object…
tb_Projects model = new tb_Projects(); model.OwnerId = ; string FieldName = "OwnerId";//字段名称 "; Type t = model.GetType(); var p = t.GetProperty(FieldName); if (!p.PropertyType.IsGenericType) { p.SetValue(model, Convert.ChangeType(Value, p.P…