FileVersionInfo.FileVersion Özellik

Tanım

Dosya sürüm numarasını alır.

public:
 property System::String ^ FileVersion { System::String ^ get(); };
public string? FileVersion { get; }
public string FileVersion { get; }
member this.FileVersion : string
Public ReadOnly Property FileVersion As String

Özellik Değeri

Dosyanın sürüm numarası veya null dosyanın sürüm bilgileri içermemesi.

Örnekler

Aşağıdaki örnek, Not Defteri için öğesini GetVersionInfo almak için öğesini çağırırFileVersionInfo. Ardından dosya açıklamasını ve sürüm numarasını bir metin kutusuna yazdırır. Bu kod örneği oluşturuldu varsayılır textBox1 .


using System;
using System.IO;
using System.Diagnostics;

class Class1
{
    public static void Main(string[] args)
    {
        // Get the file version for the notepad.
        FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo(Path.Combine(Environment.SystemDirectory, "Notepad.exe"));

        // Print the file name and version number.
        Console.WriteLine("File: " + myFileVersionInfo.FileDescription + Environment.NewLine +
           "Version number: " + myFileVersionInfo.FileVersion);
    }
}
Imports System.IO
Imports System.Diagnostics



Class Class1

    Public Shared Sub Main(ByVal args() As String)
        ' Get the file version for the notepad.
        Dim myFileVersionInfo As FileVersionInfo = FileVersionInfo.GetVersionInfo(Path.Combine(Environment.SystemDirectory, "Notepad.exe"))


        ' Print the file name and version number.
        Console.WriteLine("File: " + myFileVersionInfo.FileDescription + Environment.NewLine + "Version number: " + myFileVersionInfo.FileVersion)

    End Sub
End Class

Açıklamalar

Genellikle, bir sürüm numarası "ana sayı.ikincil sayı.derleme numarası.özel parça numarası" olarak görüntülenir. Dosya sürüm numarası, bir dosyanın sürüm numarasını aşağıdaki gibi tutan 64 bitlik bir sayıdır:

Şunlara uygulanır

Ayrıca bkz.