Length Property
Collapse the table of content
Expand the table of content

FileInfo.Length Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets the size, in bytes, of the current file.

Namespace:  System.IO
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
Public ReadOnly Property Length As Long

Property Value

Type: System.Int64
The size of the current file in bytes.

ExceptionCondition
IOException

Refresh cannot update the state of the file or directory.

FileNotFoundException

The file does not exist.

-or-

The Length property is called for a directory.

The value of the Length property is pre-cached if the current instance of the FileInfo object was returned from any of the following DirectoryInfomethods:

To get the latest value, call the Refresh method.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft