Efficient way to get a file size?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What's the most efficient way to get the size of a file in dotnet CF?
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top