using System; using System.Reflection;namespace Test { class TestReflection { public void MyMethod() { Type tp = this.GetType(); Console.WriteLine("namespace:" + tp.Namespace); Console.WriteLine("class:" + tp.Name); Console.WriteLine("Method:MyMethod()"); } public static void Main() { TestReflection test = new TestReflection(); test.MyMethod(); } } }
using System.Reflection;namespace Test
{
class TestReflection
{
public void MyMethod()
{
Type tp = this.GetType();
Console.WriteLine("namespace:" + tp.Namespace);
Console.WriteLine("class:" + tp.Name);
Console.WriteLine("Method:MyMethod()");
}
public static void Main()
{
TestReflection test = new TestReflection();
test.MyMethod();
}
}
}