久久―日本道色综合久久,亚洲欧美精品在线,狼狼色丁香久久婷婷综合五月,香蕉人人超,日本网站黄,国产在线观看不卡免费高清,无遮挡的毛片免费

2025年度未來銀行科技服務商TOP100
全世界各行各業(yè)聯(lián)合起來,internet一定要實現(xiàn)!

Reflection獲取.NET組件的信息

2004-02-21 eNet&Ciweek

  在以下的代碼中,我們將創(chuàng)建一個新組件對象,并且用它來加載System.Data組件。使用LoadFrom方法,可以通過組件集的路經(jīng)和文件名來加載組件。但習慣上,該文件名須和System.Data中的一致。

Dim assemblyInfo As System.Reflection.Assembly
assemblyInfo = assemblyInfo.LoadFrom( _
"C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Data.dll")

下一步,我們將通過GetModules方法循環(huán)該組件從而獲得該組件中的每一個模塊,并使用GetTypes()方法來顯示此程序集中定義的所有類型(或者類),還可以使用GetMethods.方法獲取當前 Type 的特定方法。

Dim moduleInfo As System.Reflection.Module
Dim typeInfo As System.Type
Dim methodInfo As System.Reflection.MethodInfo

For Each moduleInfo In assemblyInfo.GetModules()

Debug.WriteLine(moduleInfo.Name)
Debug.Indent()
For Each typeInfo In moduleInfo.GetTypes()
Debug.WriteLine(typeInfo.Name)
Debug.Indent()
For Each methodInfo In typeInfo.GetMethods()
Debug.WriteLine(methodInfo.Name)
Next
Next
Next

相關頻道: eNews

您對本文或本站有任何意見,請在下方提交,謝謝!

投稿信箱:tougao@enet16.com