c# 类的历遍和历遍操作
string id = Request.Form["id"];
string type = Request.Form["type"];
string info = Request.Form["info"];
usinfo u1 = nosql_usinfo.get(id);
Type t = u1.GetType();
System.Reflection.PropertyInfo[] PropertyList = t.GetProperties();
foreach (System.Reflection.PropertyInfo item in PropertyList)
{
string name = item.Name;
object value = item.GetValue(u1, null);
if(type==name)
{
item.SetValue(u1,info,null);
}
}
浙公网安备 33010602011771号