IsolatedStorageFileStream.Position Eigenschap

Definitie

Hiermee wordt de huidige positie van het huidige IsolatedStorageFileStream object opgehaald of ingesteld.

public:
 virtual property long Position { long get(); void set(long value); };
public override long Position { get; set; }
member this.Position : int64 with get, set
Public Overrides Property Position As Long

Waarde van eigenschap

De huidige positie van dit IsolatedStorageFileStream object.

Uitzonderingen

De positie kan niet worden ingesteld op een negatief getal.

Voorbeelden

In het volgende codevoorbeeld wordt de Position eigenschap gebruikt om gegevens naar een bestand te schrijven.

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);
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))

Opmerkingen

Het instellen van deze eigenschap werkt wanneer de CanSeek eigenschap is true.

Van toepassing op