Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

application versions

Status
Not open for further replies.

ssj3gohan

Programmer
Jun 2, 2003
34
AU
i have just recently started in vb.net, holding back upgrading from vb6 due to cost.

Anyway, I want to add a splash screen showing version and author etc.

In vb 6 there was a simple code of app.major for version app.minor for point release and app.revision for revision.

in short: the app. code was very heavily used by me and i cannot seem to find a replacement for it in VB .NET (I am using 2003 by the way)

Thanks.
 
I generallu use the following for version info:
Code:
GetExecutingAssembly.FullName.Split(",")(1).Replace("Version=", "").Trim
Not sure if it's the best way or not though.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Here's the Load function from my splash screen:

Code:
    Private Sub ProcessLoad()

      Dim Title As String
      Dim Description As String
      Dim Company As String
      Dim Product As String
      Dim CopyWrite As String
      Dim Version As String

      Dim a As [Assembly] = [Assembly].GetEntryAssembly()
      Dim attr As Object
      For Each attr In a.GetCustomAttributes(False)
        If TypeOf attr Is AssemblyTitleAttribute Then
          Title = CType(attr, AssemblyTitleAttribute).Title
        ElseIf TypeOf attr Is AssemblyDescriptionAttribute Then
          Description = CType(attr, AssemblyDescriptionAttribute).Description
        ElseIf TypeOf attr Is AssemblyCompanyAttribute Then
          Company = CType(attr, AssemblyCompanyAttribute).Company
        ElseIf TypeOf attr Is AssemblyProductAttribute Then
          Product = CType(attr, AssemblyProductAttribute).Product
        ElseIf TypeOf attr Is AssemblyCopyrightAttribute Then
          CopyWrite = CType(attr, AssemblyCopyrightAttribute).Copyright
        ElseIf TypeOf attr Is AssemblyVersionAttribute Then
          Version = CType(attr, AssemblyVersionAttribute).Version
        End If
      Next
      If Version = "" Then Version = Application.ProductVersion


      Me.Text = "About: " & Title
      Me.lblAppName.Text = Title
      Me.lblProductVersion.Text = Product & " v" & Version
      Me.lblDesc.Text = Description
      Me.lblCopywrite.Text = CopyWrite & " by " & Company

    End Sub

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Rick - shouldn't that be copyright not copywrite? [smile]


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top