Condividi tramite


IsolatedStorageFileStream.Position Proprietà

Definizione

Ottiene o imposta la posizione corrente dell'oggetto corrente IsolatedStorageFileStream .

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

Valore della proprietà

Posizione corrente di questo IsolatedStorageFileStream oggetto.

Eccezioni

La posizione non può essere impostata su un numero negativo.

Esempio

Nell'esempio di codice seguente viene utilizzata la Position proprietà per scrivere dati in un file.

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

Commenti

L'impostazione di questa proprietà funziona quando la CanSeek proprietà è true.

Si applica a