遍历所有的属性清空字符串的值
摘要:public void ClearData() { System.Reflection.PropertyInfo[] properties = this.GetType().GetProperties(); foreach (System.Reflection.PropertyInfo property in properties) { if (property.PropertyType.FullName=="System.String") property.SetValue(this, "", null); } }
阅读全文
posted @
2013-09-12 11:29
万德源
阅读(339)
推荐(0)