|
-
November 6th, 2006, 08:34 AM
#1
Obtaining application version information
Could someone please enlighten me as to how I can read the version of a natively compiled application?
Thanks!
-
November 16th, 2006, 08:51 PM
#2
Re: Obtaining application version information
You could use the Environment class
e.g
Environment.Version.Build
Environment.Version.Major
Environment.Version.Revision
Back after a long hibernation.
-
November 16th, 2006, 09:30 PM
#3
Re: Obtaining application version information
Environment.Version will give you the version number of the .NET Framework.
Are you asking how you can look at an executable in the file system and get it's version, as opposed to the version of your own app? If so then you would use FileVersionInfo.GetVersionInfo to get a FileVersionInfo object and then use the appropriate properties to get the information you need.
-
November 22nd, 2006, 03:56 PM
#4
Re: Obtaining application version information
You can also get this information and more from the Assembly.
Code:
using System.Reflection;
Assembly exeAssembly = Assembly.GetExecutingAssembly();
object[] attributes = exeAssembly.GetCustomAttributes( false );
foreach( object attribute in attributes )
{
...
else if( attribute is AssemblyFileVersionAttribute )
{
this.fileVersionTextLabel.Text = ((AssemblyFileVersionAttribute)attribute).Version;
}
...
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|