Returns a FileVersionInfo representing the version information associated with the specified file.
[Visual Basic] Public Shared Function GetVersionInfo( _ ByVal fileName As String _ ) As FileVersionInfo [C#] public static FileVersionInfo GetVersionInfo( string fileName ); [C++] public: static FileVersionInfo* GetVersionInfo( String* fileName ); [JScript] public static function GetVersionInfo( fileName : String ) : FileVersionInfo;
A FileVersionInfo containing information about the file. If the file was not found, the FileVersionInfo will contain only the name of the file requested.
The following example calls GetVersionInfo to get a FileVersionInfo for the Notepad. Then it prints the file description and version number in a text box. This code assumes TextBox1 has been instantiated.
[Visual Basic]
Private Sub GetFileVersion() 'Get the file version for the Notepad. Dim myFileVersionInfo As System.Winforms.FileVersionInfo myFileVersionInfo = System.Winforms.FileVersionInfo.GetVersionInfo("c:\WINNT\Notepad.exe") 'Print the file name and version number. TextBox1.Text = "File: " & myFileVersionInfo.FileDescription & crlf TextBox1.Text &= "Version Number: " & myFileVersionInfo.FileVersion End Sub
FileVersionInfo Class | FileVersionInfo Members | System.WinForms Namespace | SpecialBuild | ProductVersion | ProductPrivatePart | ProductName | ProductMinorPart | ProductMajorPart | ProductBuildPart | PrivateBuild | OriginalFilename | LegalTrademarks | LegalCopyright | IsSpecialBuild | IsPreRelease | IsPrivateBuild | IsPatched | IsDebug | InternalName | FileVersion | FilePrivatePart | FileName | FileMinorPart | FileMajorPart | FileMajorPart | FileDescription | FileBuildPart | CompanyName | Comments | Comments | Comments