Howto retrieve all available classes in an assembly?

F

Friso Wiskerke

Hi all,

Is it possible in VB.NET to retrieve a list of available classes in the
current assembly?

I know that there are many things you can do with the System.Reflection
namespace, like dynamically creating an instance of a class, but I haven't
found anything which can help me in getting the info out of the assembly
what I want.

TIA,
Friso Wiskerke
 
B

Bob

Imports System.Reflection

....

Public Function GetAllClassesInAssembly(ByVal asm As [Assembly]) As
Type()
Dim ret(-1) As Type
Dim counter As Integer = -1
For Each t As Type In asm.GetTypes
If t.IsClass Then
counter += 1
ReDim Preserve ret(counter)
ret(counter) = t
End If
Next
Return ret
End Function
 
C

Cor Ligthert

Friso,

Did you ever look at the object browser that looks for me much more too your
question?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top