show release version

Hello,

I have 2 forms that i need to show the respective version in a dialog box or in another form.
something like this:

form1 version: 1.0.0.0
form2 version: 1.0.0.1
Cpyright..........

Im thinking to put in a class so that's any new form can use it.
Any idea


Answer this question

show release version

  • DimitrybInTime

    Hi,
    not sure whether I understand your issue but if it is about versioning then Assembly is the right place to store version numbers.
    Just put the following "tag" into your AssemblyInfo.cs file
    [assembly : AssemblyVersion("0.3.*")]

    Then you can simply get this numbers from your code e.g. like this:

    AssemblyName assembly = AssemblyName.GetAssemblyName(path + "\\yourFile.dll/exe");
    string version = assembly.Version.Major + "." + assembly.Version.Minor;

    The result in this case would be "0.3".

    hope this helps

    cheers

  • pkrug

    I'd say go with a ListBox in a design similar to how the About page of Visual Studio 2005 (and Express) looks. If you made it into a control just provde a method that would take in the objects name and it's Version (ie System.Version ) and store it internally.



  • hrubesh

    do you have a simple example

  • show release version