When you right-click the attributes of a file and switch to the "version" page in the pop-up dialog box, we can see a lot of information about the file version.ProgramHow to get it?
It mainly uses system. Diagnostics. fileversioninfo (see msdn for details)
CodeAs follows:
Get file version information
/// <Summary>
/// Get File Information
/// </Summary>
/// <Param name = "FILENAME"> Complete path name </Param>
/// <Returns> </returns>
String Fungetplugininfo ( String Filename)
{
String Strinfo = Filename;
Try
{
System. Diagnostics. fileversioninfo fileinfo = System. Diagnostics. fileversioninfo. getversioninfo (filename );
If (Fileinfo ! = Null )
Strinfo =
" Product Name " + Fileinfo. productname + " \ R \ n " +
" Company: " + Fileinfo. companyName + " \ R \ n " +
" File version: " + Fileinfo. fileversion + " \ R \ n " +
" Product Version: " + Fileinfo. productversion + " \ R \ n " +
" Copyright: " + Fileinfo. legalcopyright + " \ R \ n " +
" Language: " + Fileinfo. Language + " \ R \ n " +
" Registered Trademark: " + Fileinfo. legaltrademarks + " \ R \ n " +
" File Path: " + Fileinfo. filename;
}
Catch (Exception ex)
{
Devcomponents. dotnetbar. messageboxex. Show (ex. Message );
}
Return Strinfo;
}
System. Diagnostics. fileversioninfo has many attributes. For more information, see msdn