using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
namespace Test
{
class Program
{
static void Main(string[] args)
{
User u = new User();
u.name_ = "ytjjyy";
u.password_ = "XXXBBBCCCC";
Type t = u.GetType();
foreach (PropertyInfo info in t.GetProperties())
{
Console.WriteLine(info.GetValue(u, null));
Console.WriteLine(info.Name);
}
Console.Read();
}
}
public class User
{
public string name_ { get; set; }
public string password_ { get; set; }
public string retrievename()
{
return name_;
}
}
}