語言

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

適用於