using System;
using System.Reflection;
public class Apple {
public int nSeeds;
public void Ripen() {
}
}
public class TypeOfApp {
static void Main(string[] args) {
Type t = typeof(Apple);
string className = t.ToString();
Console.WriteLine(className);
Console.WriteLine(className);
MethodInfo[] methods = t.GetMethods();
foreach (MethodInfo method in methods) {
Console.WriteLine(method.ToString());
}
Console.WriteLine(className);
MemberInfo[] allMembers = t.GetMembers();
foreach (MemberInfo member in allMembers) {
Console.WriteLine(member.ToString());
}
}
}
|