Hi

i want to display version information on my MDI form text

Below code displays "1.0.0.0" it doesnot display rivision no

Me.Text = System.Windows.Forms.Application.ProductVersion

how can i display version revision ?

thanks

Try thisMe.Text = "ver " & Me.GetType.Assembly.GetName.Version.ToString

still geving Version 1.0.0.0

it should have been 1.0.0.14

You can Try this

Me.Text = String.Format("{0}.{1}.{2}.{3}.{4}", My.Application.Info.Version.Major, My.Application.Info.Version.MajorRevision, My.Application.Info.Version.Minor, My.Application.Info.Version.MinorRevision, My.Application.Info.Version.Revision)

still result is same.
still geving Version 1.0.0.0

You must have to Change the Assembly version of your project. To do that in Project Properties window, go to Application Tab, Click AssemblyInformation button. Now, in this window change the Assembly version as you desire, then Click ‘Ok’ and save it.
In Assembly Information, there are four textboxes.
1. Major version
2. Minor version
3. Build
4. Revision
I am hopeful using following codification you can get your desired result.

Me.Text = String.Format("{0}.{1}.{2}.{3}", My.Application.Info.Version.Major, My.Application.Info.Version.Minor, My.Application.Info.Version.Build, My.Application.Info.Version.Revision)

ok
its works,i think i will have to change manualy for every publish.

thanks

As santanu das describe how to change the assembly information.
then all after you have to add this code in form load event

so when you change assembly version the label will change to that version.

Me.LabelVersion.Text = String.Format("Version {0}", My.Application.Deployment.CurrentVersion.ToString)

when you are adding about form then I find this code, and i use this for my projects.

or you can also use this

me.labelversion.text = My.Application.Info.Version.ToString

or

me.labelversion.text = System.Windows.Forms.Application.ProductVersion.ToString
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.