Create a project and add text box with a name of txtFileDetails and make it multi-line to run the code below.
Imports System Imports System.IO Public Class Form1 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim FileName As String FileName = "C:temp<EXE or DLL Filename>" txtFileDetails.Text += FileName & Environment.NewLine txtFileDetails.Text += (GetFileVersionInfo(FileName)) & Environment.NewLine txtFileDetails.Text += GetFileSize(FileName).ToString() & " Bytes" End Sub Function GetFileVersionInfo(ByVal filename As String) As String Return Version.Parse(FileVersionInfo.GetVersionInfo(filename).FileVersion).ToString() End Function Private Function GetFileSize(ByVal MyFilePath As String) As Long Dim MyFile As New FileInfo(MyFilePath) Dim FileSize As Long = MyFile.Length Return FileSize End Function End Class
Last Updated on October 26, 2015