IsolatedStorageFileStream.WriteByte(Byte) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将单个字节写入对象 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))