FileVersionInfo.ToString Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Retourne une liste partielle des propriétés dans les FileVersionInfo valeurs et leurs valeurs.
public:
override System::String ^ ToString();
public override string ToString();
override this.ToString : unit -> string
Public Overrides Function ToString () As String
Retours
Liste des propriétés suivantes dans cette classe et leurs valeurs :
FileName, , InternalName, FileVersionOriginalFilename, FileDescription, ProductName, ProductVersionIsDebugIsPatchedIsPreReleaseIsPrivateBuildIsSpecialBuild
Si le fichier ne contenait pas d’informations de version, cette liste contient uniquement le nom du fichier demandé. Les valeurs booléennes seront false, et toutes les autres entrées seront null.
Exemples
L’exemple d’appel GetVersionInfo suivant permet d’obtenir le FileVersionInfo Bloc-notes. Ensuite, il appelle ToString pour imprimer une liste des informations de version de fichier dans une zone de texte. Ce code suppose qu’il textBox1 a été instancié.
private void GetFileVersion2()
{
// Get the file version for the notepad.
FileVersionInfo myFileVersionInfo =
FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\\Notepad.exe");
// Print all the version information.
textBox1.Text = myFileVersionInfo.ToString();
}
Private Sub GetFileVersion2()
' Get the file version for the notepad.
Dim myFileVersionInfo As FileVersionInfo = _
FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\Notepad.exe")
' Print all the version information.
textBox1.Text = myFileVersionInfo.ToString()
End Sub