Using Reflector,
URL:http://www.aisto.com/roeder/dotnet/D...=Reflector.zip, I
see in System.Reflecti on there is a class called AssemblyTitleAt tribute. It
has a read only property named Title. I do the following to get my
application name.
Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim apptitle As System.Reflecti on.AssemblyTitl eAttribute
Me.Label1.Text = apptitle.Title. ToString
End Sub
Error is:
An unhandled exception of type 'System.NullRef erenceException ' occurred in
MainForm.exe
Additional information: Object reference not set to an instance of an
object.
However, if I try to declare an instance:
Dim apptitle As New System.Reflecti on.AssemblyTitl eAttribute
I get this error under apptitle:
Argument not specified for parameter 'title' of Public Sub New(Title As
String)
Can I use the above class to get the title? There's a work around available
to getting assembly file info but it requires a lot of code. I'd like to
understand what I have done wrong here though.
Thanks,
Brett