using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Console_AOP
{
class Program
{
static void Main(string[] args)
{
/// string으로 객체 타입을 얻는다
/// - typeName :System.Type.AssemblyQualifiedName
///
Type atype = Type.GetType("Console_AOP.TEST, Console_AOP");
// == Type atype = Type.GetType("Console_AOP.TEST");
object a = System.Activator.CreateInstance(atype);
TEST test = (TEST)a;
Console.Write(test.GetAddress(10));
}
}
class TEST
{
public string _Name;
public string _HP;
public string GetAddress(int _NO)
{
return "서울시 양천구 목2동 537-20";
}
}
}
'GET > Reflection' 카테고리의 다른 글
간단 invoke, casting Sample -1 ... & 필드, 프로퍼티, 메소드 (0) | 2009.09.24 |
---|