③窺一斑而知全豹,一個對象實例泄漏的密秘(這個比較爽)通過一個對象實例,我們可以獲得包含這個對象實例的類的Assembly,進而獲得整個Assembly的信息.
1using System;
2using System.Reflection;
3namespace TestReflection
4{
5 class Program
6 {
7 public static void Main(string[] args)
8 {
9 object A = new AX();
10 //獲取對象所屬的Assembly的所有類的基本信息
11 new TestObjectType().TestObjectTypeNow(A);
12 }
13 }
14
15 class AX
16 {
17 internal int kkkkkkkk = 0;
18 public int ooooooooo;
19 private int property;
20
21 public int Property
22 {
23 get { return property; }
24 set { property = value; }
25 }
26 public void A()
27 {
28 Console.WriteLine("AX's function!~");
29 }
30 }
31
32 class AXzhz
33 {
34 }
35
36 class TestObjectType
37