Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get version number at runtime
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00968397
Message ID:
00968441
Vues:
10
Well I figured out how to do this. Please feel free to comment if there is a better way or more prefered way to do this.
System.Diagnostics.FileVersionInfo myFVI = System.Diagnostics.FileVersionInfo.GetVersionInfo("SBoxCollect.exe");
MessageBox.Show("Major:"+myFVI.FileMajorPart.ToString()+"\nMinor:"+myFVI.FileMinorPart.ToString()+"\nBuild:"+myFVI.FileBuildPart.ToString());
I am going to use this to display version information in my About window.
It seems odd that I have to specify what file I want the version info for, it should default to current running file if not specified.

Einar


>I thought this would be easy. I want to know the major, minor, buid and revision numbers at run-time.
>The code I thought would work didn't work.
>
>System.Reflection.AssemblyName myAssName = new System.Reflection.AssemblyName();
>MessageBox.Show("Major:"+myAssName.Version.Major.ToString()+"\nMinor:"+myAssName.Version.Minor.ToString()+"\nBuild:"+myAssName.Version.Build.ToString()+"\nRev:"+myAssName.Version.Revision.ToString());
>
>
>How do I get this information?
>
>Thanks,
>Einar
Semper ubi sub ubi.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform