IsolatedStorageFileStream.WriteByte(Byte) 方法

定义

将单个字节写入对象 IsolatedStorageFileStream

public:
 override void WriteByte(System::Byte value);
public override void WriteByte(byte value);
override this.WriteByte : byte -> unit
Public Overrides Sub WriteByte (value As Byte)

参数

value
Byte

要写入独立存储文件的字节值。

例外

写入尝试超过对象的配额 IsolatedStorageFileStream

示例

下面的代码示例演示如何 WriteByte 使用该方法从 IsolatedStorageFileStream 对象读取数据。 有关此示例的完整上下文,请参阅 IsolatedStorageFileStream 概述。

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

适用于