Efficient way to get a file size?

  • Thread starter Thread starter Guest
  • Start date Start date
Use the FileInfo class and it's length property e.g.

[C#]
FileInfo fi = new FileInfo("\\My Documents\\todo.txt");
long len = fi.Length;

[VB]
Dim fi As New FileInfo("\My Documents\todo.txt")
Dim len As Int64 = fi.Length

Peter
 
Back
Top