首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

PropertyType.GetValue() 方法的参数值到底要怎样填写?该怎么解决

2012-06-12 
PropertyType.GetValue() 方法的参数值到底要怎样填写?foreach (PropertyInfo pi in pis){if (pi.Property

PropertyType.GetValue() 方法的参数值到底要怎样填写?
foreach (PropertyInfo pi in pis)
  {
  if (pi.PropertyType.FullName == "System.String")
  pi.SetValue(pi.GetValue(pi.Name, null).ToString().Replace("'", "''"), "System.String", null);
  }

这是源码, GetValue的这个方法的第一个参数具体要传什么进去, 不是很清楚.

[解决办法]
属性名
public string Name
{
get{;}
set{;}
}
传“Name"

热点排行