Getting File size in .net 2.0
By Anuraj P on April 24th, 2007 . No Comments .
Code to get size of a file in bytes
Public Shared Function getFileSize(ByVal Filename as string) as Integer return IO.File.ReadAllBytes(Filename).Length End Function
I got some additional comments from my friend, Prasanth, to Get the File Version, using the System.Diagnostics namespace.
System.Diagnostics.FileVersionInfo.GetVersionInfo(FileName.ToString).FileVersion.ToString
Thanks to Prasanth.