Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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)

public long Length { get; }

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: