Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

Get file metadata

Posted on June 27, 2014October 26, 2015 By David Kittell

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
Originally Posted on June 27, 2014
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code VB.NET

Post navigation

Previous post
Next post

Related Posts

Data Metrics

Posted on September 9, 2013October 26, 2015

In a plan to make metrics easier to record and show I have built my own database tables to record custom metrics. Metrics – Year View C# Metrics Admin Page C# Table Creation SET NOCOUNT ON DECLARE @month INT ,@year INT ,@start_date DATETIME ,@end_date DATETIME SET @month = ( SELECT…

Read More

Basic4Android – Compass Direction

Posted on September 15, 2017

Sub GetCompassDirection(bearing As Double) As String Dim tmp As Int ‘ Set Default Direction Dim direction As String : direction = "N" tmp = Floor(Round(bearing / 22.5)) Select Case tmp Case 1 direction = "NNE" Case 2 direction = "NE" Case 3 direction = "ENE" Case 4 direction = "E"…

Read More

Mac OSX Terminal – Bash – Convert MP3 to M4R (iPhone Ringtone)

Posted on April 30, 2018

If you have an MP3 that you’d like to use for your iPhone the script below will help you get that file into your ringtone options. #!/bin/sh # ConvertMP3_To_iPhone.sh # # # Created by David Kittell on 4/30/18. # DIR=$1 mkdir -p $DIR/iPhone cd $DIR for f in *.mp3 do…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes