How to get .exe file version number from file path

前端 未结 7 1923
猫巷女王i
猫巷女王i 2020-12-08 06:16

I am using .Net 3.5/4.0 with code in C#.

I am trying to get a version number of an exe file on my C: drive.

For example path is: c:\\Program\\demo.exe. If t

7条回答
  •  一整个雨季
    2020-12-08 06:47

    • Solution 1

      Dim fileVer As FileVersionInfo = FileVersionInfo.GetVersionInfo(Environment.CurrentDirectory + "\yourExe.exe")
      yourLabel.Text = fileVer.FileVersion
      
    • Solution 2

      Get File Version Number

      yourLabel.Text = Application.ProductVersion
      

    Both solutions will give 1.0.0.0

提交回复
热议问题