473,396 Members | 1,933 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,396 software developers and data experts.

Version number display in About screen

Hello

I would like to display the Version number of my application in the
About screen. I manually set this value in the Properties of my
deployment project. How can this value be accessed at runtime?

Thanks for any help!
Nov 20 '05 #1
3 1725
If you specify it in the assemblyinfo, you can get to it like this (just one
example, it can get much more complex)
System.Diagnostics.FileVersionInfo.GetVersionInfo( System.Reflection.Assembly
..GetExecutingAssembly.Location).FileMajorPart.ToS tring

"dave" <th*****@mailcity.com> wrote in message
news:f9**************************@posting.google.c om...
Hello

I would like to display the Version number of my application in the
About screen. I manually set this value in the Properties of my
deployment project. How can this value be accessed at runtime?

Thanks for any help!

Nov 20 '05 #2
Dave,

I'm not sure about getting it when you set the version in your deployment
project, but this is how I get it if I set it in the <AssemblyVersion>
attribute in the AssemblyInfo file in the project:

-------------------------------
Imports System.Reflection
.......

With [Assembly].GetEntryAssembly.GetName
lblVersion.Text = "Version: " & .Version.ToString(2) & " (Build " &
..Version.Build.ToString & ")"
End With

-------------------------------

The above example gets the version of the *entry* assembly (the main program
that started your code).

HTH,

Trev.

"dave" <th*****@mailcity.com> wrote in message
news:f9**************************@posting.google.c om...
Hello

I would like to display the Version number of my application in the
About screen. I manually set this value in the Properties of my
deployment project. How can this value be accessed at runtime?

Thanks for any help!

Nov 20 '05 #3
I, too, am not sure how to get it if you set it in your deployment project, but if you set it in the AssemblyInfo.vb file (and if you are retrieving the version of the main running application), then there's a much easier way to do it than some other people have informed you. As long as you are getting the version of the assembly that is loaded by default when you open the executable (and not an assembly that is, say, loaded into the AppDomain after the fact, or an assembly being used as a resource), then you can simply use the Application.ProductVersion string object

That's how I usually do it

Ben
Nov 20 '05 #4

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

Similar topics

4
by: Shufen | last post by:
Hi, I'm a newbie that just started to learn python, html and etc. I have some questions to ask and hope that someone can help me on. I'm trying to code a python script (with HTML) to get...
133
by: Jane Withnolastname | last post by:
I have a web page that uses an unordered list (<UL>) and the LH (list header) tag. I know LH is a valid tag because it is clearly defined by the W3C here:...
2
by: Cary | last post by:
In my project, I want to display the version number on the splash screen and in the help section of my application. I have a variable I created called appVersion. When I go to my deployment project...
3
by: Geoff | last post by:
Hi Can anybody help me with the following problem? I have a vb.net application which has a setup project. In the setup I can specify the version number of the application. I would like to...
5
by: Lyners | last post by:
I have a VB.NET application that is deployed to an end user. I would like to display on screen the application version of the application so that I know the end user id using the latest version of...
89
by: Randy Webb | last post by:
There is an updated version of the FAQ at: <URL: http://jibbering.com/faq/newfaq/> The changes/modifications to date are: 2.3 Corrected "span" to "spam". 2.3 Updated with a note about not...
2
by: Zim Babwe | last post by:
I posted in another group but thought this was the better place to post, since it had to do with the vb language I have been making changes to my Windows Application and in the...
2
by: Vayse | last post by:
On my Help/About screen, I'd like to display 1) The version number, as it appears in the Publish screen. 2) The version number of the Report Viewer control. How would I do this? Thanks Vayse
9
by: Zim Babwe | last post by:
Doesn't anyone display the version and revision number in their VB.NET application on the "about" screen or somewhere else? I need to know how to display that information also. Any help would...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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,...

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.