IsolatedStorageFileStream.Position 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置当前 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
属性值
此 IsolatedStorageFileStream 对象的当前位置。
例外
该位置不能设置为负数。
示例
下面的代码示例使用 Position 属性将数据写入文件。
Console::WriteLine( "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( "Total Bytes Read: {0}", source->Length.ToString() );
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))
注解
当 属性为 true
时,CanSeek设置此属性有效。