473,508 Members | 2,226 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1198
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
1408
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
7103
by: alejandro lapeyre | last post by:
How can I load / parse an HTML file with .NET? Thanks! Best regards, Alejandro Lapeyre
4
4875
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
2836
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
276
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
2102
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
4440
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
2663
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
6330
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
7123
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7326
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
7383
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...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7498
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...
0
5627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1557
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.