Using Reflector,
URL:http://www.aisto.com/roeder/dotnet/D...=Reflector.zip, I
see in System.Reflection there is a class called AssemblyTitleAttribute. It
has a read only property named Title. I do the following to get my
application name.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim apptitle As System.Reflection.AssemblyTitleAttribute
Me.Label1.Text = apptitle.Title.ToString
End Sub
Error is:
An unhandled exception of type 'System.NullReferenceException' 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.Reflection.AssemblyTitleAttribute
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