John Wheal John Wheal - 1 year ago 114 Question

Determining file size in VB.NET

How do I determine the size of a text file?

I know that I could just count characters, but the file will be several MB's large.

Answer Source
Dim myFile As New FileInfo("file.txt")
Dim sizeInBytes As Long = myFile.Length
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download