2010-09-01 47 views
1

我們可以使用System.Reflection從.dll中提取結構的名稱嗎?
請建議一些鏈接。如何從.dll中提取結構類型名稱?

struct MyStruct // <-- this name i wanna to find from .dll using Reflection 
{ 
    private int length; 
    private int breadth; 
    public int Area(int length,int breadth) 
    { 
     return length*breadth; 
    } 
} 
+3

程序集可以包含「無限」數量的類型。請更具體地說明你的問題。 – leppie 2010-09-01 10:44:19

+0

「結構名稱」是什麼意思? – Peter 2010-09-01 10:47:25

+0

對不起,我已從其他來源獲得解決方案。謝謝 – 2010-09-24 05:01:07

回答

4

您可以通過調用Assembly.GetTypes()得到一個組件(.DLL)所有類型的列表方法。可以從Type.Name屬性中訪問每種類型的名稱。

相關問題