public class refInfo
{
public int ID { get; set; }
public string Name { get; set; }
public int Sex { get; set; }
public string Adress { get; set; }
public override string ToString()
{
StringBuilder sb = new StringBuilder();
System.Reflection.PropertyInfo[] infos = this.GetType().GetProperties();
foreach (var x in infos)
{
sb.Append(string.Format("{0}:{1};", x.Name, x.GetValue(this, null)));
}
return sb.ToString();
}
}
{
public int ID { get; set; }
public string Name { get; set; }
public int Sex { get; set; }
public string Adress { get; set; }
public override string ToString()
{
StringBuilder sb = new StringBuilder();
System.Reflection.PropertyInfo[] infos = this.GetType().GetProperties();
foreach (var x in infos)
{
sb.Append(string.Format("{0}:{1};", x.Name, x.GetValue(this, null)));
}
return sb.ToString();
}
}