ASPNET 스트리밍 클래스 속성, 값

2235 단어 asp
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_;
}
}
}

좋은 웹페이지 즐겨찾기