using System;
using System.Reflection;

namespace Reflect
{
    class Profile
    {
        private string name;
        private string phone;

        public Profile()
        {
            name = ""; phone = "";
        }

        public Profile(string name, string phone)
        {
            this.name = name;
            this.phone = phone;
        }

        public void Print()
        {
            Console.WriteLine("{0}, {1}", name, phone);
        }

        public string Name { get; set; }
        public string Phone { get; set; }
    }

    class MainApp
    {
        static void Main(string[] args)
        {
            Type type = Type.GetType("DynamicInstance.Profile");
            MethodInfo methodinfo = type.GetMethod("Print");
            PropertyInfo NameProperty = type.GetProperty("Name");
PropertyInfo PhoneProperty = type.GetProperty("Phone");

            object profile = Activator.CreateInstance(type, "박상현", "512-1234");    
            methodinfo.Invoke(profile, null);

            profile = Activator.CreateInstance(type);
            NameProperty.SetValue(profile, "박찬호", null);
            PhoneProperty.SetValue(profile, "997-5511", null);

            Console.WriteLine("{0} {1}", NameProperty.GetValue(profile, null), NameProperty.GetValue(profile, null));
        }
    }
}


예외 발생되는데 왜뜨는지 모르겟서유 ㅠㅠ