This documentation is archived and is not being maintained.

IsolatedStorageFileStream.Length Property

Gets the length of the IsolatedStorageFileStream.

[Visual Basic]
Overrides Public ReadOnly Property Length As Long
[C#]
public override long Length {get;}
[C++]
public: __property __int64 get_Length();
[JScript]
public override function get Length() : long;

Property Value

The length of the IsolatedStorageFileStream in bytes.

Remarks

Length represents the number of bytes currently in the file. It is not affected by isolated storage quota.

Example

[Visual Basic, C#, C++] The following code example demonstrates the Length property.

[Visual Basic] 
Console.WriteLine("Writing data to the new file.")
While source.Position < source.Length
    inputChar = CByte(source.ReadByte())
    target.WriteByte(inputChar)
End While

' Determine the size of the IsolatedStorageFileStream
' by checking its Length property.
Console.WriteLine(("Total Bytes Read: " & source.Length))

[C#] 
Console.WriteLine("Writing data to the new file.");
while (source.Position < source.Length)
{
    inputChar = (byte)source.ReadByte();
    target.WriteByte(inputChar);
}

// Determine the size of the IsolatedStorageFileStream
// by checking its Length property.
Console.WriteLine("Total Bytes Read: " + source.Length);

[C++] 
Console::WriteLine(S"Writing data to the new file.");
while (source->Position < source->Length)
{
   inputChar = (Byte)source->ReadByte();
   target->WriteByte((Byte)source->ReadByte());
}

// Determine the size of the IsolatedStorageFileStream
// by checking its Length property.
Console::WriteLine(S"Total Bytes Read: {0}", source->Length.ToString());

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

IsolatedStorageFileStream Class | IsolatedStorageFileStream Members | System.IO.IsolatedStorage Namespace

Show: