473,394 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Howto retrieve all available classes in an assembly?

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
Nov 21 '05 #1
4 1192
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

"Friso Wiskerke" <fr***@pestaartje.nl> wrote in message
news:u9**************@tk2msftngp13.phx.gbl...
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

Nov 21 '05 #2
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

"Friso Wiskerke" <fr***@pestaartje.nl> wrote in message
news:u9**************@tk2msftngp13.phx.gbl...
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

Nov 21 '05 #3
Friso,

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

Cor
Nov 21 '05 #4
Friso,

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

Cor
Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jesse | last post by:
Besides looping through all the types in an assembly, is there any way to retreive all of the classes that have a custome attribute applied? For example, I have a PersistentAttribute, I won't to...
5
by: alejandro lapeyre | last post by:
How can I load / parse an HTML file with .NET? Thanks! Best regards, Alejandro Lapeyre
4
by: Digital Fart | last post by:
howto make a connection to database available in my classes. What is the best practice when i want to write classes that need a connection to the database? Do i make a conn variable in my...
4
by: Ray Dukes | last post by:
What I am looking to do is map the implementation of interface properties and functions to an inherited method of the base class. Please see below. ...
0
by: Friso Wiskerke | last post by:
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...
5
by: ffrugone | last post by:
My scenario involves two classes and a database. I have the classes "Broom" and "Closet". I want to use a static method from the "Closet" class to search the database for a matching "Broom". If...
4
by: Alan Mailer | last post by:
Again, I'm new to VB.net and there is something I need help with: Like (I assume) many of us, over time I want to be able to create some VB.net classes that I might want to use in more than one...
7
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file...
9
by: =?Utf-8?B?VGhvbWFzIFcuIEJyb3du?= | last post by:
"parez" wrote: Assembly.LoadWithPartialName does indeed work!! Now, why is this incredibly useful routine deprecated and we are instructed to use Assembly.Load instead which does not provide...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.